I have the following question:
Can I have 2 loadMovies on the same frame like : ?
loadMovie(“one.swf”, “targetone”);
loadMovieNum(“1b.swf”, 1);
stop();
Thanx
I have the following question:
Can I have 2 loadMovies on the same frame like : ?
loadMovie(“one.swf”, “targetone”);
loadMovieNum(“1b.swf”, 1);
stop();
Thanx
hi Melissa,
Of course you can. if you want to have the movies load on Enter Frame, you can put two “holder” clips on the main stage.
A holder clip is just an empty movieclip.
put the two holder clips wherever you want on the stage and give them instance names (like loadspace1, loadspace 2).
Now i usually put all my code on another empty mc (sometimes referred to as controlller).
on this i would put:
onClipEvent (enterFrame){
_root.loadspace1.loadMovie(“one.swf” );
_rootloadspace2.loadMovie(“1b.swf” );
}
Remember that all loaded movieclips have there registration point onthe top left of the clip.
People don’t really load into levels anymore, this method is much easier and precise. If you are using MX, then you can create the holder clips with actionscript.
i can’t remember the code off hand but there are loads of tutorials on the web about it. (www.actionscript.org has one i think).
hope this helps.
Kd
Thank you that helped me a bit
I wrote the following code in the 1st frame of an empty mc (on my scene with the 2 other empty(holders) mc, giving them the instances, but the syntax seems wrong:
onClipEvent (enterFrame){
_root.loadspace1.loadMovie(“one.swf” );
_root.loadspace2.loadMovie(“1b.swf” );
}
Also another thing, all this in located in another mc(session1), so do i need to change the path like:
_root.session1.loadspace1.loadMovie(“one.swf”)
??
hey,
the syntax is correct. Are you used to using / ?
try this as a test. Take out the code in the controller.
Put a button the stage and add:
on(release){
_root.session1.loadspace1.loadMovie(“one.swf” );
_root.session1.loadspace2.loadMovie(“1b.swf” );
}
I might have made a mistake with the onEnterFrame, so try this to make sure that the swfs load ok.
I think you need to make a variable to do the onEnterFrame action i wrote. If the above works, send me the fla and i’ll sort it out for you.
Do you know how to target variables (not the technical name)? That’s really good to know. i can give you a quick tut if you like.
Your code is correct. You would add session1 if the holder clips are inside that movieclip
i’m online all day so feel free to send me stuff and i’ll help you get your head around it.
Good luck!
Kd
I cant figure out what is wrong…
I made a simplified version of my flash file for you to have a better idea…
I tried inserting the code in the frame but didnt work…
Thx for helping,
right,
i made it work by just adding:
stop();
emptymc1.loadMovie(“one.swf”);
emptymc2.loadMovie(“two.swf”);
on the second frame of the movie you sent me.
The code i gave you works when you put your actionscript on the _root of the movie.
If you want to put the code inside a movieclip, then you just add the above.
I like to do the bulk of my code on the main timeline. That way it’s easier for me to track my code as it is all in the same place.
i’ve attached your file with the changes + the little loaded movieclips. It will work now, but if you are stuck, let me know.
Hope i’ve helped!
kd:)
Well,…after a long day trying out the impossible…
But I have learned useful things !
Thank you so much for your patience and precious help!!
Mel*
Now just a last small question:
Can I add the following (setProperty)to adjust the position?
emptymc2.loadMovie(“two.swf”);
setProperty("_root.mainmc.emptymc1", _x, “100”);
setProperty("_root.mainmc.emptymc1", _y, “100”);
ok,
Have u tried the code you wrote?
i don’t use that syntax.
I would just write:
ON THE MAIN STAGE:
_root.mainmc.emptymc1._x =100;
Use this syntax when dealing with properties (i.e. _width, xscale etc).
OR
on the actual emptymc1 write:
_x=100;
(this is the same as this._x =100);
OR
where you have written the previous code,
write:
emptymc1._x=100;
Phew!
basically its all about which level you are targetting from.
i usually don’t worry about where i put stuff on the stage, because i asign all the positions of stuff using AS.
This is really precise and great when you want to do animations with AS.
Hope you feel more comfortable on the subject now.
As always, i’m happy to help.
let me know how it turns out
KD
Actually tried after posting …and well it didnt work!
Grrr…
Inserted the code you sent :
emptymc1.loadMovie(“one.swf”);
emptymc1._x = 10;
emptymc1._y = 10;
emptymc2.loadMovie(“two.swf”);
and well everything works fine now…i think*
thx again!
happy i could help.
R you at school or college?
Or have you decided that web design is for u?
There are some amazing things out there, check out www.hi-res.net
Being a Londoner and a designer, i am blown away by some of their stuff. very conceptual.
Anyway, giz a post if you get stuck on anything. It’s good to share what we learn.
kd
Hi
I have a same problem with melissa and still couldnt figure it out. Could you give me some helping hands?
Attached is the fla file and swf file I’m working on.
hi KazChix,
Ok you MUST learn this now! i had the same problem for months and it drove me nuts!
if you have one frame on your timeline, then regardless of the stop(); action, the movie will loop forever.
So what’s happening is that flash is loading your movie x times a second (x being your framerate). so you never see it!
The solution:
well there are many things.
the easiest is to put another keyframe on the second frame and put a stop(); action on there as well (therefore not a 1 frame movie - so it won’t loop).
The more advanced way is to add a variable like:
(put on frame)
_root.Loading = 1;
if(_root.Loading ==1 ){
_root.screen.loadMovie(“whatever.swf”);
_root.Loading = 0;
}
Do you see what i mean. I had this problem at the beginning as well. But if you get the basics of how flash works, then you will never struggle with it again.
Hope i helped. If you need more help, i’m happy to assist
Good luck,
Kd
:: Copyright KIRUPA 2024 //--