Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

It's killing me soflty....

Status
Not open for further replies.

walahe

IS-IT--Management
Feb 24, 2005
11
GB
I'm sure there is a simple answer to this as usuall :)

A simple movie with few same buttons and have the same code for all of buttons to stack external swf files on the stage. This is the code for each button: (obviously the button and swf names and are different for each):

menu_mc.spec_btn.onPress = function() {
var someDepth = empty_mc.getNextHighestDepth();
var mc_New = empty_mc.createEmptyMovieClip("1up", someDepth);
mc_New.loadMovie("spec.swf");
trace(someDepth);
var mc_Target = empty_mc.getInstanceAtDepth(someDepth-2);
trace("mc_Target = "+mc_Target);
if (mc_Target != undefined) {
removeMovieClip(mc_Target);
}
};

Everything is working and external swf files stack nicely on top of each other. Now, how can i load a swf when movie starts and no buttun is pressed using the same function? Its the intro.swf that must load first, and then it get stacked with the new swf files as buttons are pressed.I hope i explained properly. in simple terms:

"when movie starts, load intro.swf into the same Empty_mc using the same Function :
= function() (
var someDepth = empty_mc.getNextHighestDepth();
........the rest.

Its unbelievable how much time you can waste when you dont have enough knowledge.

Thanks for reading
Koosha
 

function myLoading(movieToLoad){
var someDepth = empty_mc.getNextHighestDepth();
var mc_New = empty_mc.createEmptyMovieClip("1up", someDepth);
mc_New.loadMovie(movieToLoad);
trace(someDepth);
var mc_Target = empty_mc.getInstanceAtDepth(someDepth-2);
trace("mc_Target = "+mc_Target);
if (mc_Target != undefined) {
removeMovieClip(mc_Target);
}
};

myLoading("intro.swf");
stop();

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
Thanks, its getting there, except for the stop(); at the end that stops all the buttons. and by removing it, buttons work but obviously the intro.swf keeps loading from beginning on top.

Any idea?

Many thanks
 
no, just the intro.swf is looping. thats when i get rid of the STOP in your code. If i leave the stop there,the intro.swf is ok, but none of the other swf files load up when clicking on the buttons.
 
Think you should leave the stop there, have the intro play, and on the ending frame of the intro, add the following to move to the next frame of the timeline...

_level0.play();



Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
I did, but that takes it to frame 1 of the main movie which is the action keyframe, and now i have 2 loops of the intro! I've put the fla file on the site if you have time to have a look, here
Sorry to trouble you.
Thank you
 
I tried all, but this is what i did and now its working:

put the intro.swf content in the main movie itself, not as a seperate swf and then this code on all the buttons. The empty1_mc attaches a blue background on top of the intro clip to mask it!! Many thanks for your help.

menu_mc.spec_btn.onPress = function() {
empty1_mc.attachMovie("blue", "newname3", 1);
var someDepth = empty_mc.getNextHighestDepth();
var mc_New = empty_mc.createEmptyMovieClip("1up", someDepth);
mc_New.loadMovie("spec.swf");
trace(someDepth);
var mc_Target = empty_mc.getInstanceAtDepth(someDepth-2);
trace("mc_Target = "+mc_Target);
if (mc_Target != undefined) {
removeMovieClip(mc_Target);;
}
};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top