Groups | Blog | Home
all groups > flash actionscript > february 2007 >

flash actionscript : Accessing Variable after a loadMovie



mbrellisford
2/17/2007 10:42:27 PM
I have 2 swf's - - First & Second

The first plays and then loadMovie's Second...
I then want the Second to access a variable that was created in first

(Basically in the first I have a path to an flv, and in the second I have a
player that needs to load that path from the first. in order to play it)

Is this possible?
kglad
2/18/2007 12:33:40 AM
yes. you can always use the absolute path to the flv from anywhere to access
it.

when in doubt you can use trace(this) on the timeline that's accessing the
object/variable your want to find (in the output panel) the absolute path that
should prefix the path/name that's already accessing the object/variable.

if you don't understand that above paragraph do two things:

1. post the path to the flv that currently works in your first fla
2. post the output panel results after placing trace(this) on the line below
your path in your first movie and testing your first movie.
mbrellisford
2/18/2007 12:42:25 AM
I cant use an absolute path because I have 10 video's and only 1 player movie.
Depending on which movie they choose it will store that videos name in a string
(first swf) and then the player will open (loadMovie) and I want it to read
that string from the first swf and play that specific file in the FLV player
(second swf).
kglad
2/18/2007 12:47:14 AM
i don't think you understand what an absolute path means. it has nothing to do with hard coding the path/name.

mbrellisford
2/18/2007 12:50:13 AM
Yah I'm not too sure I get what you are saying....

var videoToLoad:String= this._parent.toolText+".flv"

Thats the code that Im using to store the string of the flv that it needs to
load in the second swf.

When I do the trace(this) I get:
_level0.item0.icon
mbrellisford
2/18/2007 2:02:56 AM
I Figured it out. I ended up just using a _global variable.

kglad
2/18/2007 5:04:44 AM
you're welcome.

for others that may be interested:

_level0.item0.icon.videoToLoad

is the correct path/variable name to the variable storing the flv reference
(assuming that trace(this) was placed on the same timeline as the videoToLoad
assignment).

AddThis Social Bookmark Button