all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

loading an external movie and targetting a certain frame


Re: loading an external movie and targetting a certain frame Travis Newbury
4/3/2005 9:13:24 PM
flash actionscript:
[quoted text, click to view]

this.createEmptyMovieClip("MyClip",1000);
MyClip.loadMovie("SomeMovie");
MyClip.gotoAndPlay(10);


--
loading an external movie and targetting a certain frame pptdgc
4/3/2005 11:16:00 PM
I have craeted a button that loads an external movie. The action script is...

on(release){
loadMovie("externalmovie.swf",this);
}

How would I change this script so that when the movie loads it doesn't load
the first frame, but a later frame such as frame 10.

Thanks
Re: loading an external movie and targetting a certain frame kglad
4/3/2005 11:22:54 PM
hopefully, that's a movieclip button. if so, you can use:

on(release){
_root.preloadI=setInterval(_root.preloadF,80,this,10);
this.loadMovie("externalmovie.swf");
}

and attached to a frame:

function preloadF(mc,frameNum){
loaded=mc.getBytesLoaded();
total=mc.getBytesTotal();
if(loaded>0&&loaded>=total){
clearInterval(preloadI);
mc.gotoAndPlay(frameNum);
}
}
Re: loading an external movie and targetting a certain frame pptdgc
4/3/2005 11:42:48 PM
I have limited experience using flash. When you say a movieclip button... I
converted a symbol and slected 'button' as its type. I then selected the button
and opened the action script panel??

So do I attatch the first lot of code to the instance of the button, but where
do I enter the second lot of code? In ay the fist frame of the same movie? Or
the external movie that is being loaded?

Thanks for oyur help
Re: loading an external movie and targetting a certain frame kglad
4/4/2005 2:26:22 AM
you created a regular button. and the problem with that is when you execute
this.loadMovie("externalmovie.swf"), all the code on that timeline will be lost
so there's no place to locate code that will execute as that swf is loading.

there are many remedies. the simplest (assuming you don't want that button to
exist after it's released) is to convert a shape into a movieclip and use the
code in my previous message. the on(release) handler will be attached to your
movieclip and then preloadF() code will be attached to the frame that contains
your movieclip button.
Re: loading an external movie and targetting a certain frame pptdgc
4/6/2005 8:03:10 PM
I created a movie clip and then put that exact actionscript on the instance of
the movie clip. I then put the follwoing actionscript on to the same fvrame
that the movie clip is on:

function preloadF(mc,frameNum){
loaded=mc.getBytesLoaded();
total=mc.getBytesTotal();
if(loaded>0&&loaded>=total){
clearInterval(preloadI);
mc.gotoAndPlay(frameNum);
}
}

When I test the movie, It loads the external movie but on the first frame not
the tenth. Also it seems to load the external movie ontop of this one but
wrongly positioned so that all you can see is the top part of the external
movie at the bottom of the first overlaid so both are visible. I want the
external clip to replace the first one completely.

Is there anything in your code that I need to change?

Thanks for your help
Re: loading an external movie and targetting a certain frame kglad
4/6/2005 9:02:18 PM
something's not as you explain. if you have old code lying around your movie,
remove it. if that doesn't solve the problems and if the following code is
attached to your movieclip:

on(release){
_root.preloadI=setInterval(_root.preloadF,80,this,10);
this.loadMovie("externalmovie.swf");
}

upload your file somewhere and post a link.
Re: loading an external movie and targetting a certain frame pptdgc
4/6/2005 10:32:41 PM
Hi kglad,

I am still having the same problem. I created the movie clip button again and
attatched the code to it but have the same problems. The page the movie clip
button is on is the final page of a quiz I created using the quiz wizard in
flash. (final score page). I am trying to create a button that will link back
to my original flash movie at frame 10.

I don't have any webspace. Could I e-mail you my file. My e-mail is
peter.m.ross@student.shu.ac.uk. If you e-mail me I will reply with the attached
file.

Thanks for your help

Pete
Re: loading an external movie and targetting a certain frame kglad
4/6/2005 11:15:15 PM
Re: loading an external movie and targetting a certain frame kglad
4/7/2005 12:00:00 AM
Re: loading an external movie and targetting a certain frame kglad
4/8/2005 12:00:00 AM
the problems were not in the actionscript except he wanted a gotoAndStop(10)
instead of a gotoAndPlay(10). the other problems were all design problems: he
needed to increase the stage size and he needed to loaded into another _level
and fade out the _level0 movie to make his presentation look right.
Re: loading an external movie and targetting a certain frame Dragnods
4/8/2005 4:03:45 AM
Hey.... Can you please post what the solution was...... I am having the exact same problem, and the exact same results with your code.....


Help will be appreciated....
thanks..
Re: loading an external movie and targetting a certain frame angelina28
4/18/2005 12:00:00 AM
Hi there...I am having the same issue with positioning the external .swf as
pptdgc was having:
<Also it seems to load the external movie ontop of this one but wrongly
positioned so that all >
<you can see is the top part of the external movie at the bottom of the
first overlaid so both are >
<visible. I want the external clip to replace the first one completely.>
This is exactly what I am experiencing. I am using the provided script by
Kglad for my movieclip button and the corresponding frame to load an external
..swf. I find no real solution in this thread and was hoping someone or Kglad
could provide a more indepth resolution. Kglad did mention loading into
another _level but would need more clarification on this.

Thanks a bunch!

AddThis Social Bookmark Button