-
dynamically creating instance name of movie clip
Hi everyone
a shove inthe right direction very much needed.
I have a movie clip (Lets call it mc01.swf) that I am loadin on my main movie.
this movioe clip is loaded inside an empty container in my main movie. the contaner mc han instant name "contmc"
I want to stop the loaded Mc i.e mc01.swf whcih is loading inside the empty container.
any idea how i can target the time line of teh loaded movieclip??
thanks for your help
P.S. im using flash MX
faith_love_hope
www.surfunion.com
-
FK Supermodel
-
-
:(
i did that it does not work
faith_love_hope
www.surfunion.com
-
FK's Giant
If it didn't work then there may be a problem in the spelling of the paths.
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
it worked
Okie thisis crazy!!
and for some reason now i'm totaly dazed and confused
The path is correct this is what I did
In the empty container mc i.e. "contmc" on the first frame i gave the load movie script and targeted "contmc"
now "contmc" is on the main time line.
on the main time line i gave the following script
_root.contmc.Stop();
I gave this on the 70th frame (becasue the loaded movie is 50 frames long and I am loding it on the 20th frame of the main time line)
AND THIS WORKED.
Initially this script
_root.contmc.Stop();
was inside the "contmc' movie clip and it didnt work then
i even tried _root.contmc.this.Stop(); but it didnt work
any explaination?
Is tehre a way to give an instance name dynamically to a movie thats being loaded ??
thanks for your time and help.
faith_love_hope
www.surfunion.com
-
FK's Giant
Thas a good question. I know how to dynamically name MC's already there, but not? Hmm....
But as for your problem, that's strange. Dunno why it wouldn't work.
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
stop(); or this.stop(); alone (and not Stop();) would of done it on the last frame of the movie clip!
-
-
When you load an external movie in a container clip, the container clip's content is replaced by the loaded movie, and that movie is now referred to with the container's instance name.
That's why it works when using _root.contmc.stop(); (no capital S), because your stopping whatever is in the container clip, which is now your loaded movie.
But you could also have another empty control clip that would constantly monitor the "contmc" clip's current frame and stop it whenever you wanted.
As for dynamic naming and creating a movie clip...
You can create a dynamic movie clip at runtime, and give it whatever name you want to give it. Without having tested it (because I don't really see the point), don't see why you couldn't pull in an instance name variable from a text file and use that variable when creating your dynamic movie clip. Just don't see the point!
Last edited by oldnewbie; 11-14-2003 at 01:32 AM.
-
FK's Giant
Originally posted by flash_kid76
hi Steve, thanks for your reply
...
you mean u know how to dynamically name a MC thats already there but not a MC thats being loaded??
Yea. Simple:
code: this._name="myClip";
Does this apply to all content being loaded into it? Will commands such as gotoAnd_____ and stop() and play() and all the frame controlling scripts work? Seems like they would/should.
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
Originally posted by oldnewbie
When you load an external movie in a container clip, the container clip's content is replaced by the loaded movie, and that movie is now referred to with the container's instance name.
That's why it works when using _root.contmc.stop(); (no capital S), because your stopping whatever is in the container clip, which is now your loaded movie.
my query is that the srcipt works when put outside the MC and it doesnt work if its put inside the "Contmc"
So is it becasue u cant control the timeline using
_root.contmc.stop();
if used inside the contmc?
QUOTE]Originally posted by oldnewbie
As for dynamic naming and creating a movie clip...
You can create a dynamic movie clip at runtime, and give it whatever name you want to give it. Without having tested it (because I don't really see the point), don't see why you couldn't pull in an instance name variable from a text file and use that variable when creating your dynamic movie clip. Just don't see the point! [/QUOTE]
im sorry, but I really dont understand this
im not much of a coder.
Thanks for your time and help
faith_love_hope
www.surfunion.com
-
What I'm saying is that whatever you originally put in the "contmc" movie clip, graphics, images and CODE, is lost when you load a new external movie in this clip, and replaced by the content of the new loaded movie. Only the instance's name remains the same. That's why if you put _root.contmc.stop(); in the "contmc" but then load another movie into it, that code is lost.
If the new loaded movie, had a button with that code within itself though, then it would work.
-
hey thanks Old newbie,
i figutred that out over the week end but was not too sure about it.
your explaination confirmed that my thought were inthe right direction :-)
Once again thanks for your time and help everyone
faith_love_hope
www.surfunion.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|