This is a discussion on "Loading an swf movie" within the Flash & Multimedia Forum section. This forum, and the thread "Loading an swf movie are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Loading an swf movie
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Loading an swf movie
I'm using the "loadMovie" function to load an swf file into an .fla file I'm working on BUT I'd like to have the file I just loaded start playing at frame 2 instead of frame 1. Is this possible?
Thanks! |
|
|
|
#2
|
|||
|
|||
|
yes it is possible. Insert a keyframe into Frame 2. Put the actionscript in this frame instead of Frame 1. Might I ask what you are trying to accomplish with this? I might be able to explain it in full detail if I knew more about what you are trying to do.
How To Enter A KeyFrame click on the layer you want to create it in, then press F6. Now... IF you want to load it in frame 1 and then play it in Frame 2, you will have to set up MovieClips for that. |
|
#3
|
|||
|
|||
|
As usual Kulegamr is talking complete rubbish.
Keep your loadMovie actions in the first frame, but place a stop() in the first frame of the movie that you are loading. You can target newly-loaded movies (assuming that you ARE checking that the movie you are loading is loaded!) with the tellTarget function, which you can find in Flash MX under Deprecated>Actions. If you loaded the movie to a level, then you can use tellTarget ("_level2") { play(); } where 2 is the number of your level. Putting this on the second frame of your movie that is loading the other movie, will play the loaded movie. It also just occurred to me that you could mean you want the movie you are loaded to start playing FROM frame 2... in which case you can use tellTarget and gotoAndPlay(framenumber); |
|
#4
|
|||
|
|||
|
Sorry guys, let me explain myself a little clearer.
I have a swf file containing animation and sound. Unfortunately I don't have the .fla source file for me to make edits cuz I lost it somewhere when I created this a little while back and I'm lazy to recreate it again Now... I'm building another flash movie that needs to call this swf file externally using the loadMovie function. I've tried this and works but I need to start the swf movie at frame 2 because frame 1 has a stop action preventing it from automatically playing. I hope that's a better explanation. If there's another way to do this please help. Perhaps importing the swf into the library and loading from there? Thanks! |
|
#5
|
|||
|
|||
|
No, you can easily load this movie using the loadMovie function...
Load it either to a target movieclip or a level and then just use telltarget to send the gotoAndStop(2) (assuming you want to stop on frame 2). EG, in your current movie:
|
|
#6
|
|||
|
|||
|
Thanks Sirkent, but I've tried your code without any luck unless there's something else that I did incorrectly.
I'm working in a file called "Kungfoo.fla" and trying to load "test.swf". In kungfoo.fla, all I have is a background image on layer 1, and the action script on layer 2 (all in frame 1). This is your code I used with minor tweaks: loadMovie("test.swf", _root.level1) _root.level1.onLoad = function() { tellTarget (_root.level1) { gotoAndPlay(2); } } All I get is a blank screen which I'm guessing is frame 1 of "test.swf" with a stop action. The animation starts on frame 2. Hmmm... I'll give it another go. Thanks. |
|
#7
|
|||
|
|||
|
do you have the .fla somewhere on the internet? If so please post and we can show you what to do from there. Or I can do it for you and show you exactly what I did.
|
|
#8
|
|||
|
|||
|
Kulegamr, you have completly missed the point. We are not trying to load a movie when we get to Frame 2, We are trying to load a movie and make that loaded movie go to frame 2, without changing the loaded movie.
Also I don't appreciate bitchy private messages that claim you to be right. It wasn't what he asked for, because you misunderstood. I didn't need to try it 'your way' as you put it, because I can see from concept that your way is not even what was required. rvktam: Sorry about that!!! lol. Ok, i've noticed that you can't use the movieclip.onLoad property unless you apply the code on the movieclip itself. I would suggest that, although it's possible to load this into a level, you can't keep the code to a minimum so I would suggest creating a movieclip (inside Kungfoo.fla) to load your test.swf into. Simply call it whatever you want, in this case 'movieclip'. And in Kungfoo on the main timeline, use: loadMovie("test.swf", "_root.movieclip"); Now, right-click on your movieclip inside Kungfoo and put these actions on it: onClipEvent (load) { tellTarget (_root.movieclip) { gotoAndStop(2); } } That WILL work, I've tested it!! It you want to play from frame 2, then replace gotoAndStop with gotoAndPlay. Here is the FLA file that *DOES* work. |
|
#9
|
|||
|
|||
|
Actually Sirkent... You are the one that has missed it... My movie actually loads the example in the in the first frame but starts on the movie being played on the 2nd frame.... But.. before thats not what it sounded like he wanted, even you answered wrong. Also, I was very nice to you in my PM, just said I dont appreciate the way your criticize my thoughts just because they are not pure Script like yours. Don't make me look like a bad guy. I am here to help people, and if you dont like my suggestions, I suggest you be big and keep it to yourself.
|
|
#10
|
|||
|
|||
|
Ok Kulegamr, I apologise. I didn't mean to offend you, or portray you in a bad light. However I must point out, that unless I have made some very stupid error, I haven't answered incorrectly. My first post mentioned two possibilities and the second was the one that was being asked for.
I don't understand exactly what your answer involves. Could you post a demo fla file so that I can see exactly what it is. rvktam wants to import a .swf file into his main movie. He wants the newly imported .swf file to go to frame 2, as there is a stop command on frame 1. The imported swf cannot be edited as rvktam no longer has the .fla file for it. |
|
#11
|
|||
|
|||
|
OK, I will post a .fla, Look for an edit on this post with the link, as I dont want to spam the boards.
http://www.haeglodesigns.com/Movie1.fla Thats it Yes.. Look Down for the better answer!!! |
|
#12
|
|||
|
|||
|
The above it not waiting for the movie to load properly, it's (apparently) a well documented flash thing...lol, That I didn't know about.
This link will work. http://www.digital-end.com/webforumz...es/Kungfoo.fla |
|
#13
|
|||
|
|||
|
Thanks for all your help gentlemen!
Much appreciated. |
|
#14
|
|||
|
|||
|
No problem... I am sure Sirkent will be willing to help you out anytime that he can!!!! By the way, who all of you upgraded to Macromedia Suite MX 2004???
|
|
#15
|
|||
|
|||
|
Nope, I haven't upgraded yet... Mainly because I haven't heard anyone whethet it be a colleague or a well-known designer harp on about it yet. Maybe when the new player is well spread.
|
![]() |
| Tags |
| loading, swf, movie |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help! Flash movie not loading in IE | jogajog | Flash & Multimedia Forum | 5 | Aug 11th, 2008 12:17 |
| Problem with xml-flash and loading movie property | mars | Flash & Multimedia Forum | 8 | Apr 11th, 2008 17:41 |
| HElp after loading movie in intro | dicky18 | Flash & Multimedia Forum | 0 | Mar 15th, 2007 14:23 |
| design & code problem - movie index strategy and loading movies | betso | Web Page Design | 2 | Sep 11th, 2006 20:35 |
| loading flash movie one after another | MORBIS | Flash & Multimedia Forum | 3 | Dec 15th, 2005 16:15 |