Hello, I know Flash a lot, but I’m new to AS3 and Flex and am really lost with all that is possible to do.
I was wondering if there is a way
1- In flash to create a movie clip and then ADD frames in it to create an animation, OR to use an already existing movie clip and modify individual frames (for example, switch the bitmap in frame 3 from “bluePants” to “redPants” so the character now has red pants.
2- In Flex, to import bitmaps, make them assets in compile mode and then expert the SWF to import it in a flash movie and use the assets in movie clips.
Basically, what can you do more thant just importing assets? can you mix them up with movieclips and dynamically do something interesting??
thanks
Marco
1- i don’t think you could add frames through AS, but you could still animate by using Tweeners or by event based animation. Not sure about the other question, maybe you could have 2 frames, stopped at “bluePants” first, and tell the movieclip to gotoAndStop(“redPants”);
you could use the Loader class to load images, swf’s.
The cool thing about Movie Clips is that you can stick more Movie Clips inside of it with addChild(), so just have a blank Movie Clip for your character and make a different movie for like the head, torso, legs, feet, weapon, ect… when you want to change from bluePants to redPants just call a removeChild(bluePants) then a addChild(RedPants) you can then have unlimited different combinations for your character but the downside is you have you make a different Movie Clip for each item and make sure they all line up with the same animation.
Edit Note: It would be more like characterMC.addChild() not just addchild or it would just be put on the stage and wouldnt follow characterMC’s x and y.
[quote=johnlouis;2330191]1- i don’t think you could add frames through AS, but you could still animate by using Tweeners or by event based animation. Not sure about the other question, maybe you could have 2 frames, stopped at “bluePants” first, and tell the movieclip to gotoAndStop(“redPants”);
you could use the Loader class to load images, swf’s.[/quote]
Yes, but to do that, I would need to add frames dynamically to a movie clip hehe.
Basically, what I need to do is construct an animation with the frames already existing and just swap parts of the character’s body depending on how dressed it is
Thanks yaim, but is there a way to do something like “swapChild()” instead of removing it then adding it once again? That way it would already be placed axectly at the same place.
And about my not so clear question, I have a more precise one:
Suppose I import 2 images in a Flex project in compilation mode (embeded in the SWF)
Then I dynamically create a movieClip/Sprite in the same project with two children (the two images)
So if I import that SWF file in another project, will I be able to use that dynamically created MovieClip/Sprite or will it be non-existant?
now that’s better
No, swapChild() just swaps the z-order (front-to-back order) of the two specified child objects. addChild() and removeChild() seem to be the only way to do it. When you addChild() it places it a 0,0 of the parent object so if you make the pants/item movie clip with an offset already, then they would be placed exactly at the same place already.
I dont really use external SWF files, but I dont see why it would be non-existant. Unless I dont fully understand what you are saying or trying to do.
Loool, I didn’t even know there was a swapChild() method
Anyway I heard about a thing called shared libraries, maybe I’ll use that instead of SWFs