简体   繁体   中英

Load an Image in Multiple movie clips using as3

I am really curious of asking a particular question to everyone of you. I am creating an Application in flash that is lot similar to this Application Zazzle Case Cover

I am almost ready with what i was supposed to do and How i have to do. But, still i am ain't a very big Tech_geek to handle all these . I list out some of the things which i could`nt achieve. Kindly help me if possible.

  1. I know that inorder to load unlimited number of images in a Movie Clip, we need Array. But to go with it, I am not sure of framing it properly.
  2. I have Merged certain codings from internet and encoded it to act as the Application in that Site for a Single image in a Single view, but when i try to add child or make it display the same image in all other views i can't frame the coding. It is not behaving properly .
  3. Last but not the Least, I am confused of displaying the Bitmap data in as3... I wanted to show the Uploaded Panel Image in the below thmbnail area but i am not so sure of it.

The Questionnaire format of the Above problems are

  • How to upload unlimited number of images in a Movie Clip using Array ?
  • Is it is possible to Display the same image in two Movie Clips simultaneously using addChild ? I had lots of blah and blah but this area plays the 2nd Question and even Answer for it. But i am ain't sure revealing the Answer.

     function onMovieClipLoaderComplete(event:Event):void { // Hide progress bar progressBar.visible=false; var loadedContent:DisplayObject=event.target.content; var loader:Loader=event.target.loader as Loader; loadedContent.x=-37.625; loadedContent.y=-37.625; loadedContent.width=75.25; loadedContent.height=75.25; trace("loadedContent.width="+loadedContent.x); trace("loadedContent.height="+loadedContent.y); mcOnStage=true; con1.container.addChild(loader); clears.addEventListener(MouseEvent.CLICK, removeMC); function removeMC(MouseEvent):void { trace("Its Removed"); if (mcOnStage ) { con1.container.removeChild(loader); con1.textcontainer.removeChild(txt); mcOnStage=false; } } } 

    "con1.container.addChild(loader);"

    Can i add "con1.container2.addChild(loader);" for the same loaded image.

  • How to Clone a Movieclip's Bitmap data and Display it in another area or Movieclip ???

Guide me if possible...

I have included the SWF file along with this Question... https://docs.google.com/file/d/0B5jnHM1zpP4MOHRCeWFqX05sSTA/edit?usp=sharing

Can Someone check the first Site and gimme little notes of how can i bring all those modules in this flash as3 based application.

Here's how you would display the same image twice, with reference to the code you included in your post:

//here's your code
var loadedContent:DisplayObject=event.target.content as DisplayObject;

//create bitmap data instance same size and as the loaded content   
var transparent:Boolean = true; 
var fillColor:uint = 0xFFFFFFFF;    
var bitmapData:BitmapData = new BitmapData(loadedContent.width, loadedContent.height, transparent, fillColor);

//draw the loaded content into the bitmap data
bitmapData.draw( loadedContent );

//create new bitmap 
var bitmap:Bitmap = new Bitmap( bitmapData);

//add the loaded content
con1.container.addChild(loader);

//add your 'cloned' content
con1.container2.addChild( bitmap ); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM