?
Solved

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

Posted on 2010-09-23
8
Medium Priority
?
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.
Suggested Courses

649 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