I have a little problem with addChild when i try to add a movieClip from library,My MC has some code inside. (I converted my application to the movieClip and now i need to add it to my stage).
when I add it to my stage with addChild(mc); my movieClip added to stage, but my codes did't work!!!!!!
Do you have any idea to how can solve this problem?
When you say you converted your application to a MovieClip, do you mean that you imported an swf file and turned it into a MovieClip? If so, importing the swf will cause it to lose all of its code. If not, explain more regarding what you mean when you say you converted an application to a MovieClip.
No I didn't convert to swf. I only converted my Scene 1 contents to a movieclip (like textFields). When I added this movieclip to stage without addChild, It works properly, But when I use addChild my codes didn't work!!!
addChild will not load something from your library - you need to assign the library symbol a class name and instantiate it like you would any class instance.
What code are you using to load it from the library?
What is the code in your movieclip that is not working?
What does the code normally make your movieclip do?
Are you getting any error messages?
I assigned class name to my movie clip. Ned my my MC loaded but my codes didn't work!!
"What code are you using to load it from the library?"
var mm:Sprite = new main1();
"What is the code in your movieclip that is not working? "
a simple code like:
myMc.alpha = 0;
"Are you getting any error messages?"
No. I didn't get any error