Solved

Pass variables to external SWF file

Posted on 2008-10-21
2
918 Views
Last Modified: 2013-11-11
We are designing a shell, which will be used to play numerous external swf files by choosing them from a list. We will have an online version, and a version that the user installs to their computer. The Shell will eventually be an exe file, but the movies it plays will still be swfs. I want to put a line of code into each SWF to make sure that it was being played through our shell and I was hoping that the shell could set a security variable to true, and then the SWF checks to make sire its true, then play the movie, otherwise unload it. I know you can normally pass variables my using something like myMovie.swf?var1=true, but that only seems to work in the browser. Is there anyway to do this from within flash when loading a movie?

If not, is there any other way to protect the individual SWF files, and make sure they can only be played through our shell?
0
Comment
Question by:newstandard
2 Comments
 
LVL 37

Accepted Solution

by:
CyanBlue earned 500 total points
ID: 22772880
You could set a variable in a shell like this...

var var1:Boolean = true;

and in the child SWF, check to see if that variable exists or not by doing this...

if (_root.var1 == true)
{
   play();
}
else
{
   stop();
}

CyanBlue
0
 

Author Comment

by:newstandard
ID: 22775866
Wow, for some reason. I didn't think it was that simple. I thought that the swf was not able to read variables in the parents shell, and that the shell somehow had to pass the variable to the swf. That works, thank you very much!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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…
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 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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now