Solved

Pass variables to external SWF file

Posted on 2008-10-21
2
919 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.

867 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

21 Experts available now in Live!

Get 1:1 Help Now