attachMovie() problem
- Started
- Last post
- 12 Responses
- fitsum
in my library, I have a movieclip symbol - call it "mc_x" - that I'd like to attach to a movie on that's on the stage - call that "mc_stage". I've given "mc_x" a linkage id - call it "mc_x_linkID". in the "script" layer on my main timeline, which is only 1 frame long, I wrote:
mc_stage.attachMovie("mc_x_linkI...
I also tried adding a clipevent script to "mc_stage" where
onClipEvent(enterFrame){
this..attachMovie("mc_x_linkID...
}neither is working. thoughts?
- fugged0
your level should be > 0.
mc_stage.attachMovie ("mc_x_linkID","mc_x _instanceName",1).
- fugged0
sorry wasn't paying attention to what you were doing. 0 is fine.
make sure that your movieclip instance "mc_stage" actually has an instance name of "mc_stage".
mc_stage.attachMovie ("mc_x_linkID","mc_x _instanceName",0).
^ that will work fine if the instance on the stage is named properly and the symbol in your library has the correct id.
- fitsum0
still no dice. any idea what may be missing? I definitely dont have any scripts that are preventing this from happenning
- fitsum0
no worries. yes, instance is properly named
- fitsum0
any thoughts?
- bufo0
Right click your movie in your Library. Then click the checkbox that says "Export for ActionScript". Then you fill in the "Identifier" text field. Say that your Identifier field name is "myMC", then you would attach your movie like this:
this.attachMovie("myMC", "myMC1", 0);
it might not be a good idea to use your onClipEvent(enterFrame) to attach the movie. That means that, the movie will be attached everytime a frame goes by. Hope this helps.
- bufo0
oops.. i meant to say... right click your movieclip in your Library. Then go to "Properties". Then you do the checkbox for "Export for ActionScript"... and then the rest I said.
- fitsum0
bufo, like I wrote in the first post, I gave the mc a linkage ID and the export to actionscript was checked.
I have n prblem when I go
_root.attachMovie
but I can't seem to get it to attach to a movieclip that already lives on stage.
- fitsum0
the .fla wont open. I', using mx 2004 pro.
- fitsum0
got it working. what an ass ache. Basically the mc I wanted to attach contains a bitmap. what I should have done is select the bit map, and convert that into an mc instead of making an mc and adding the pic to the timeline.
thanks to all helpers