[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to get a .swf file to run in a .fla project (Flash CS5, AS3)

Posted on 2010-09-23
8
Medium Priority
?
488 Views
Last Modified: 2013-11-11
I have the wonderful joy of redesigning a website so it is 100% done in flash. I use to program in flash but I haven't touched it in years so I need to learn the basics all over again.

I created a .swf file that works perfectly (It's a slide show of a number of images).
Now I'm trying to figure out a way to include this .swf file into my .fla file.

I'm able to import it to my library and have its symbol on the flash website but when I look at the website, the .swf file/symbol does nothing. When I open up the .swf file on its own, it runs without any problems.

What do I need to do to fix this problem?
0
Comment
Question by:JohnnyBCJ
  • 5
  • 2
8 Comments
 
LVL 4

Expert Comment

by:thepanch
ID: 33747441
use the loadMovie

loadMovie('ToLoad.swf',mvTheMovie,'GET');

http://www.flashperfection.com/tutorials/How-to-use-loadMovie-function-59957.html
0
 

Author Comment

by:JohnnyBCJ
ID: 33747484
Ok, Thanks for the comment!
Give me a few minutes to try out your suggestion and I'll get back to you.
0
 

Author Comment

by:JohnnyBCJ
ID: 33747594
As much as I'm trying to figure this out, I can't.

I'm following as closely as I can but I'm clearly missing something because I can't get this to work.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 8

Accepted Solution

by:
ActionScript_Helper earned 2000 total points
ID: 33751268
You can load that SWF at runtime, instead of putting that into Library.

As you are writing it in AS3, so here's the AS3 code to load external SWF:

==========

var swf1:Loader = new Loader();
swf1.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
swf1.load(new URLRequest("xyz.swf")); //replace "xyz.swf" with the original swf path

function imageLoaded(evt:Event):void
{
      // replace "this" with the parent container name where would you like to add the loaded SWF
      this.addChild(evt.target.content);
}

==========
0
 

Author Comment

by:JohnnyBCJ
ID: 33752711
Thank you ActionScript Helper!

I followed your code and got it working but not quite 100%. Using your code I have the .swf file running in the top left corner (because I'm still using the following code...)

// replace "this" with the parent container name where would you like to add the loaded SWF
this.addChild(evt.target.content);

What are you refering to? a Movie Clip for example?
0
 

Author Comment

by:JohnnyBCJ
ID: 33752912
Better yet, this was working until I did something that I can't figure out.

Now when I run the file I get the following error:

Your content will not stream. Runtime Shared Library (RSL) preloading will require all of your content to download before the first frame will play.

To prevent this you can change the Runtime Shared Library Library Settings in the Advanced ActionScript 3.0 Settings dialog which can be raised from the PublishSettingsdialog.

The Runtime Shared Libraries being preloaded are:

textLayout_1.0.0.595.swz for TLF Text



What do I do to solve this?
0
 

Author Closing Comment

by:JohnnyBCJ
ID: 33754631
Thanks Again!
0
 
LVL 8

Expert Comment

by:ActionScript_Helper
ID: 33759490
I rarely use Flash CS5, and there are some new publishing settings for RSL in CS5 and I am not quite aware of that.. so may be will check and let you know if I find anything..
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

872 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