?
Solved

Pass variables to external SWF file

Posted on 2008-10-21
2
Medium Priority
?
924 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

771 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