Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : Variable Question ???


CF_Admin
5/5/2004 11:16:53 PM
Does anyone know a way to pass variables directly between Flash movies (from one .swf to another .swf) without using HTTP?

CF_Admin
5/6/2004 4:29:31 AM
rlc5611
5/6/2004 4:40:05 AM
If you can be a little more explicit on what you are trying to do, I am sure
you will get a positive response. For example, are you trying to communicate
between movies loaded at various levels or are you trying to pass variables
from one to another while loading?
kakas
5/6/2004 4:45:02 AM
hi,

got some questions...where r u running this swf r u using loadmovie num? can u plz explain what exactly r u trying

CF_Admin
5/6/2004 4:50:57 AM
I would like to pass a variable from movie to another when launching the second
movie from the first... i.e. from one .swf file to another .swf file. I know
this can be done through HTTP, but what if they are running in the stand alone
player, or using HTTP is not possible or desirable. It also seems to me to be
cleaner and more secure generally, if it can be done. MM Help and online
support is useless. It cetainly contained no reference, positive or negitive,
that I could find... From my experience though, that doesn't mean it can't be
done.

It could also be useful, although not in any current projects I have, to pass
a variable from one movie to another when both are open concurrently.

But regardless of the context, is it possible at all?
CF_Admin
5/6/2004 4:52:54 AM
It doesn't matter... I could use LoadMovieNum, or loadMovie, if that's what I
need to do. Currently I am using getURL and passing it in HTTP. I just want to
know if it can be done another way, more directly.
CF_Admin
5/6/2004 4:59:25 AM
[q][i]Originally posted by: [b][b]kakas[/b][/b][/i]
hi,

got some questions...where r u running this swf r u using loadmovie num? can u
plz explain what exactly r u trying

Umesh (kakas)[/q]


I am doing some of the ActionScript for an online chat room that is completely
in Flash. The chat portion, done by someone else, uses the Flash Communication
Server. I am mostly doing the Flash Remoting portion, using ColdFusion... in
addition, there are a lot of variables that need to passed. Every "screen" is a
seperate movie. I can pass the variables through HTTP. I can grab others back
through remoting. But it would be extremely useful to pass them directly
between .swf files without using HTTP or Remoting. I just want to know is there
anyway to do that.

I'd like to know in general too, for my information, and possibly to use in
other current and future projects, which is why my original question was more
general...

CF_Admin
5/7/2004 8:25:01 AM
BarneyK
5/7/2004 12:22:19 PM
Could be shot down here but could you not use javascript? As far as I am aware
if you have a page with two frames in each containing an swf, you can call a
javascript function with getURL and this will stay client side - i.e. there is
no http request and response involved. This would mean that passing variables
between 2 swf's that are within the same frameset should be quick as it will
not involve going back to the server.

Have I understood you right? Or do you not want to include a browser at all?
Without embedding the movies as part of an html page I do not see how you can
do it as it would involve calls to the OS.

Cheers
UCF NewMedia
5/7/2004 1:30:17 PM
It is possible. Look at the documentation for LocalConnection. It allows any
flash file running in either the player or a browser plugin to talk to any
other flash file... So if you can see flash, they can talk to eachover.

Heres a link to macromedia's technotes.
http://www.macromedia.com/support/flash/ts/documents/localconnection.htm

Using this saved my life. Back a while ago when the function was nearly
undocumented, One of the university's sites was using frames with flash. Using
javascript to talk to one another was a huge pain because it wasnt supported by
all the browsers. LocalConnect all of a sudden made the site platform and
browser independant.

Its easy and rock solid.
CF_Admin
5/7/2004 3:05:55 PM
LocalConnection

Now that is exactly what I was looking for!

Thank you UCF NewMedia!!!

And thank you to BarneyK (and everyone else too) as well. I knew you could use
JavaScript, but Idid realize that would send the variable without HTTP, so that
also answered my quesyion... but what I had in mind that I was looking for was
more along the lines of LocalConnection. I'll try it and let everyone know how
it goes (or if I have more questions, lol (^;)

AddThis Social Bookmark Button