Solved

Pass variables to external SWF file

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

749 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