ciao ragazzi!
ho creato una funzione che mi crea un oggetto bitmap al suo interno.
vorrei utilizzare l'oggetto creato per applicare dei filtri
solo che nn so come fare a richiamare l'oggetto appena creato
dopo aver chiamato la func vorrei poter utilizzare myBitmap...codice:carica_img = function (dest_mc:MovieClip, file_name):BitmapData { //create a movie clip to hold the external file this.createEmptyMovieClip("holder", this.getNextHighestDepth()); /* Use the MovieClipLoader class so we can be told when the external file loads or fails to load */ loader = new MovieClipLoader(); //Give us status updates by firing events loader.addListener(this); //Load the external file into the holding movie clip loader.loadClip(file_name, holder); //this function is called by the 'loader' object when the file is loaded and ready to use loader.onLoadInit = function() { //Create a new bitmap object in memory that is the same size as //the loaded file and fill it with transparent pixels myBitmap = new BitmapData(holder._width, holder._height, true, 0x00FFFFFF); //Snapshot the movie clip that contains the external file we loaded myBitmap.draw(holder); // //we don't need this movie clip anymore, so remove it //we already have the bmp in myBitmap istance //NOTE that bmp doesn't appear since we attach it on a clip holder.removeMovieClip(); // // _root.test.attachBitmap(myBitmap, 1); }; //this function is called by the 'loader' object if the file couldn't be loadd function onLoadError() { /* The external file failed to load so we don't need the holding movieclip anymore */ holder.removeMovieClip(); } return myBitmap; };
ma come valore è undefined
sapete dirmi perchè?
grazieeeee


Rispondi quotando