Groups | Blog | Home
all groups > flash (macromedia) > november 2003 >

flash (macromedia) : Pass Variable from Loaded SWF


K_C
11/4/2003 10:37:18 PM
Hey -

I have an SWF that basically just has mc placeholders where I load other swfs. One of those swfs is a login movie. If the user is logged in then it stores a variable uservalidated = true.

That is fine, the problem is that I want to make sure that the placeholder movie (which has navigation links) wont let the user continue on into the site unless uservalidated = true.

How do I pass the variables from one loaded swf to the main swf?

I can send and receive variables from a db, but I have never done any swf to swf.

Any help or links would be great.

KC

Laiverd.COM
11/5/2003 1:53:07 AM
Actually I have no clue as to how exactly you have set things up, so i'll
give you some general hints and tips
1. start having a look in the manual on the subject of working with
different timelines (I'm not joking, it's there ;-)

Each flash movie has it's own timeline called _root. From each movieclip on
that timeline you can refer to a variable declared on _root as
_root.varName. If the timeline of only one level up; refer to the timeline
below it as _parent.varName

If you want to go from _root to a variable declared inside a movieclip (sya
we gave it the instancename myFirstMc), then from root you could reach that
variable by using myFirstMc.varName Say myFirstMc would contain a nested
second movieclip called mySecondMc (I'm running out of creativity here ;-)
then from _root you would read a variable inside mySecondMc with
_root.myFirstMc.mySecondMc.varname etc. etc.

As obviously you are not loading anything into a level I will not get into
that; look it up in the manual. For now just remember that each level has
it's own root.

Okay; you may have a coffee now and let it sink in.

John

--
----------------------------------------------------------------------
Please reply only to the group, so everyone may share
----------------------------------------------------------------------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
http://www.macromedia.com/desdev/mx/flash/
http://www.macromedia.com/v1/tipsubmission/maintopic_browse.cfm
----------------------------------------------------------------------

AddThis Social Bookmark Button