Loading an swf movie

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.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Nov 7th, 2003, 17:20
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Nov 7th, 2003, 19:30
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Nov 7th, 2003, 20:01
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Nov 7th, 2003, 20:54
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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 . In this .fla file, frame 1 is blank containing a stop () action. On frame 2 is where the animation begins.

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Nov 7th, 2003, 21:14
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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:

Code: Select all
loadMovie("file.swf", "_root.movieclip");
_root.movieclip.onLoad = function() {
    tellTarget ("_root.movieclip") {
        gotoAndStop(2);
    }
};
Hope that helps...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Nov 7th, 2003, 23:18
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Nov 8th, 2003, 02:45
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Nov 8th, 2003, 08:57
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old Nov 8th, 2003, 13:31
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Nov 8th, 2003, 18:04
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Nov 8th, 2003, 19:55
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
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 YAY!

Yes.. Look Down for the better answer!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Nov 8th, 2003, 21:22
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #13  
Old Nov 10th, 2003, 21:21
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for all your help gentlemen!
Much appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #14  
Old Nov 10th, 2003, 22:42
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
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???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #15  
Old Nov 11th, 2003, 07:32
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
loading, swf, movie

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 21:48.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42