?
Solved

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

Posted on 2010-09-23
8
Medium Priority
?
486 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 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