Solved

Dynamically loading swfs no buttons

Posted on 2003-11-20
10
253 Views
Last Modified: 2010-04-03
Sure it works with a button but...

Is it possible to have a dynamically loaded swf navigate to a frame on the main timeline? The swfs have an accompanying narration track.

I have attempted loading the swfs and  sound files both dynamically wihtin the main timeline. I had limited success using "onSoundComplete" but it often cuts off the swf animation when it jumps to the new frame. So ideally I would like the swf and narration to complete then go to the desired frame.
0
Comment
Question by:doitinhouse
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 1

Expert Comment

by:text_problems
ID: 9791562
not sure exactly what you mean.

to target the root you can just put an action on the last frame of the loaded swf:

_root.gotoAndPlay("your_frame_label");
0
 

Author Comment

by:doitinhouse
ID: 9791898
Thanks for your response. I tried that before posting but I may have been doing something wrong. I'll give it another shot.

I've been using the Flash series since Flash 4 and this past week purchased Flash MX 2004 Pro.

I was looking at a feature in Flash MX 2004 pro that sounds helpful but I can't quite figure it out. Maybe I'm sniffing around the wrong tree..

     this._lockroot = true

If I meet with success I'll let you know.
0
 
LVL 1

Expert Comment

by:text_problems
ID: 9792003
I'm afraiid I'm only on mx - but the code I posted will do it. Once a swf is loaded to another movie it is treated as part of that movie.

If you load my.swf to _root.my_holder, all code in my.swf will work as if it were on the timeline of _root.my_holder.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 27

Expert Comment

by:negatyve
ID: 9792246
this._lockroot = true

if you write this line in the first frame of your external movie, when you load it in the main movie, on a level or in a movieclip, if you use "_root" inside it, it will always be pointing to the external movie "_root", and not to the main movie "_root" as it used to do in the past (creating path issue).
0
 

Author Comment

by:doitinhouse
ID: 9793134
the problem seems to be that no matter what command I put into the external swf
it only pertains to the root timeline of the that external swf.

here's what's going on:

I have a movieclip  "myclip"

It's on the main timeline.
In the first frame of  "myclip"
   loadMovie("swfs/tour1.swf",2)

It loads it plays.

In the last frame of the loaded "tour1.swf "I have tried the following while troubleshooting with no luck

_root.gotoAndPlay("tour2");

root.gotoAndPlay("tour2");

gotoAndPlay("tour2"); (if "tour1.swf" has frame labeled"tour2" it does navigate within the "tour1.swf" timeline)

It never seems to send the command
(and yes there is a "tour2" label further down on the main timeline )

Im sure it's a path issue but it's late my head hurts. Need a break. If I ever figure it out I will try to let you all know where I went astray. Hopefully we can keep some future Flasher out of a similar mess.

Thanks for all responses.




0
 
LVL 1

Expert Comment

by:text_problems
ID: 9795420
does your external swf definitely load?
is there something wrong with the timeline of your external clip to stop it getting to the last frame?
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9795490
1. it's not:

loadMovie("swfs/tour1.swf",2)

but

this.loadMovie("swfs/tour1.swf")

instead

2.

try this too:

this._parent.gotoAndPlay("tour2");
0
 

Author Comment

by:doitinhouse
ID: 9796149
This works. The original logic was correct and a simple typ9o was preventing my call from the external swf from hitting the root. One of those typos that come from sitting in front of Flsh for too long. Frustrating. Thanks for all posts, walking thru it helped find the issue.

Here's what I ended up with.

--- for actionscript for emtpy movieclip in main timeline:

yourmovieclipinstancename.loadMovie("swfs/tour1.swf",2)
firstSound=new Sound()
firstSound.loadSound("swfs/vo/1opener.mp3",true)
stop();
//firstSound.onSoundComplete = function() {
//gotoandplay("tour2");
//;
//}
//firstSound.start();

----note: that the commented out/// section would use the external sound file end to trigger to the frame label "tour2" in the main timeline
---- firstSound function loads external sound file -- narration in my case-- "true" sets it to stream.

--actionscript in the last frame of external swf "tour1.swf"

 _root.goToAndPlay("tour2")

Thanks again to all.



0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12186223
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do I convert a CS4 FLA file to CS6? 1 872
Look at this Flash vs Html5 version of the same animation.  Is Html5 slower? 7 402
Adobe Indesign CS6 4 119
flash in chrome 4 100
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question