Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Passing Variables



anyone know about any good tutorials on how to pass variables from one movieclip to another?

thanks!



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-15-2002, 09:58 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Help: Passing Variables (180 Variables) To Function
hi

if i have call function like this

Math.findMax(app1, app2, app3, app4, app5, app6, app7, app8, app9, app10, app11);

but the values i have to app180

i don't want to write all this

Math.findMax(app1, ... , app180); //!!??

how i can to called the function from app1 to app180

Math.findMax(FROMapp1, ... , TOapp180);

thanx

Passing Variables To Swf
hi !

go here :

http://www.guistuff.com/tools/flashdrop/flashmenu.swf




then go here :

http://www.guistuff.com/tools/flashd...5&makenavurl4=



now can any body tell me what i have to do to the fla in order to send varibale to swf and make menu feilds dyanmically- also i want the variable comming from a db .

any help ?

suhailkaleem

Passing Variables
Owkee, me again

Hmm I have created a preloader with a movie that loops inside it. In that movie i calculate the percentage loaded and bytes loaded. These calculated values are stored in a variable called 'var4'.
Now is it possible to pass that variable 'var4' to the main movie ? And how do I fix this ?

Passing Variables
Is it possible to pass a variable from a buttonpush that is in an MC that needs to control the _root movie? In other words: rootmovie/MC/button -->variable assigned to control main (root) movie. For some reason I cannot get flash to recognize my requests....here is the code that I am using in the button:

on (release) {
var x = 5;
_root.gotoAndPlay ("monnonego");
}


Here is the code that asks the question, assigned to a keyframe (later down the root movie):

if (x == 3) {
gotoAndPlay ("profile", 34);
} else {
if (x == 4) {
gotoAndPlay ("portfolio", 34);
} else {
if (x == 5) {
gotoAndPlay ("contact", 34);
}
}
}

Any ideas?? Thanks in advanced!!

- Sigma

Passing Variables
I have some actionscript that doesn't work. I don't see what's wrong. Can anybody help me? It's about the towers of Hanoi. Here is my script:


var intaantal = AantalSchijven;
var intstart = 1;
var inteinde = 3;

function hanoi (n,intstartstaaf,inteindstaaf) {
if (n == 1) {
van = intstartstaaf;
naar = inteindstaaf;
trace(van);
trace(naar);
} else {
inttussenstaaf = ((6 - intstartstaaf) - inteindstaaf);
hanoi(n-1,intstartstaaf,inttussenstaaf);
van = intstartstaaf;
naar = inteindstaaf;
trace(van);
trace(naar);
//trace(inttussenstaaf);
hanoi(n-1,inttussenstaaf,inteindstaaf);
}
}
hanoi(intaantal,intstart,inteinde);
stop ();

I made a program in VB in the same way and the program works. In the program I use byval for the variable n. Maybe that's the reason why it doesn't work but what can I do?

Greetings,
Geerty.

Passing Variables From PHP (or Whatever)
it's fun and easy!

(found my answer, deleted query)
[Edited by Cakkafracle on 08-15-2001 at 03:58 AM]

Passing Variables Between Swf's
Hi there,

I've got 2 swf's on one html page, I need to pass a variable from one swf to the other, is it possible ??

thanx

PASSING VARIABLES TO CGI
I know this may have been answered before, but I cant seem to find it.

I need to know if anyone knows how to get Flash to pass variable info WITHOUT shifting the characters to their ASCII code... (i.e. a comma becomes %2C)

I have a cgi script (free, of course) that is looking for this:

data_order = "news,newscontent,tips"

whereas when i submit it from a flash form, it becomes this:

data%5Forder=news%2Cnewscontent%2Ctips

I'm sure someone out there has gotten this also.

Thanks in advance for any help or pointing me in the right direction.


KEEP FLASHING!

Passing Variables
Is there a way to pass a variable from one flash movie to another via a URL?

Kind of like http://www.website.com/page.html?score=30 … or something like that?


- FLASHmac

Passing Variables Instead Of Gas. Is This Possible?
I have a single frame movie as my start movie that I want to use to establish a variable. It's pretty much just saying

var exno = 2;

and then I load a movie.

When I trace it in the first movie, it's fine. It works. Great. But now I want the newly loaded swf movie to recognize this variable as well. How can I do that?

Any help would be appreciated.

Peter

Passing Variables
Movie1 (_level0) loads Movie2 to the same level. How can I pass a variable from Movie1 to Movie2? I know that it can be done by loading to a different level but is it possible when loading to the same level?

John

Passing Variables
is it possible to pass variables from movie to movie? If so, how would I go about it? thanks.

Passing Variables
i really want to pass variables to my flash movie via the url.

someone told me that if i do something like

asdfoi.swf?name=dog

then the name variable text field will show "dog"

this doesnt work.

can someone help me please

Passing Variables
I need to know how you pass variables to a swf, I know there is a way then you just have to add the variables name and it's value following the *.swf of the embed tag. But i forgot the syntax...

Can someone help please!!

Passing Variables
Hello all there!
I have created a countdown flashmovie, it counts from x seconds to zero. But the x differs from time to time, it depends on how many time is left.
What I would like to know: How can I pass a variable from my website to the flashmovie?? Propably simple but I need to know how!

Please help!
VinzZ

Passing Around Variables?
Ok so here is my question. I need to take an html form and pass the variables to a file and then have flash load those variables. I am looking for a tutorial or explanation so I can learn how to do this. Do I need a perl or php script to set and save these variables? I dont know? Anyway any help would be appreciated.

thanks
Carter

Passing Around Variables?
Ok so here is my question. I need to take an html form and pass the variables to a file and then have flash load those variables. I am looking for a tutorial or explanation so I can learn how to do this. Do I need a perl or php script to set and save these variables? I dont know? Anyway any help would be appreciated.

thanks
Carter

Passing Variables ((HELP))
I'm having trouble passing a variable from one text field to another. I have a password protected site where the user must put in his/her userName and password. If the password is correct, I want it to read "Welcome, userName.

userName is the variable name for my input text field in frame 1.

user is the variable name for my dynamic text field name in frame 3.

frame1:
var userName = "";
var user = "";
user = "userName";
stop ();
//this is my latest attempt to pass the name the user puts in to an empty text field called user in frame 3. Needless to say, its not working.

Anyone have any suggestions????

HELP - Passing Variables
Can anyone tell me how to pass a variable from the main limeline (level0) to a variable in a movie?

I've tried targetting the movie directly, but that isn't working.

Here's the code I have:

In my text file i have the following:
url=movies/slow.swf

On the main time line:
loadvariables("url.txt", 0)

In the movie:
x = level0.url

It keeps telling me that x is undefined.

Passing Variables?
I need to do something like this:
1st Screen of the Movie, asks user to input name in a form field.
2nd Screen says Welcome (*user) To My Website..etc.

how do I do this?

Passing Variables From Swf To Swf
I am designing a page with multiple .swf files on it. The main reason that I have decided to compose them outside of Flash (in html) is to still be able to use the right-click zoom feature of the flash player. I have a map in the upper left hand corner of my html page (it is a separate .swf file). I have a panel of buttons, also in a separate .swf file, on the right side of the screen. I also have a descriptive panel below the map. Here is the problem. I need to be able to have buttons in one of the .swf files communicate to another .swf, the map. I want the buttons to be able to send the map .swf to a certain frame. I also need to communicate from the map to the descriptive .swf. How can one .swf file tell another what to do when they are both contained separately in an html file?

Thanks for the help.

Passing Variables
Well, Well. Sitting here trying to create a Quiz game, but its not easy as a beginner.

Since I want to have quite alot of pictures in my game, I have tried to use LoadMovie. But how do you do to make the variables "move" to the next .swf file. I have tried the "send with GET" but can't get it working.

I made a variable score=5; for example, and in the next .swf movie I want to increase it by putting score=score+10;, How should I do?

By the way, do anyone know if you can export and import scenes?

Passing Variables HELP
I know this question probably has been posted a thousand times and all the ones I've read haven't helped me.

I have 2 swf files...

the first one has an input textbox with a variable "name"
I also have a button that links to another frame. On that frame has a loadMovieNum ("test.swf", 10);

Passing Variables From An ASP To A SWF
I have a ASP that checks for the Username and password. If the password is correct it writes a new page and calls a function from another ASP which opens a control pannel on the new page. I have a button in a flash menu that is called from the 1st asp. There is a button that I want to have open a new page with the control panel. I don't want to make the user login twice. How can I grab the output data (Name, Login or Unumber) and pass the variable thru a flash Button?

I know this sounds confusing, but there must be an easy way. If you need more info for you to help me, please feel free to e-mail me at quince@quincewyss.com
Thank you,
Quince Wyss

Passing Variables On?
I am putting together a CD-ROM that contains several 'Quick-tests'. These have been provided to me by thew client as seperate FLA files. What they want me do do for a section of the CD is have the user run through all the test and then in the final one generate results based on the variables right/wrong given by each test (which is a separate SWF)

Is there a way of gathering these variables and then displaying them at the end???

Or could I load the SWF's intom a host movie and somehow have the host movie store the variables for me?!

Or is the only way to combine the FLA's all into one????

Suggestions welcome?!

:: Passing Variables - Little Help ?
hey,
A piece I'm working on requires interactive user modes-
I think I know how to do this in theory but i need help putting it into practice.

I think it requires the following _________
3 main actions required to create an interactive/customizable user experience.

A: Nesting one movie within another using the Loadmovie/LoadMovie Num command.

B : Passing a variable from one movie to another and to have the second movie display the variable contents in a text box.

C : Passing a variable from one movie to another and have the second movie use the variable to construct a file path through which the second movie loads a third movie.
_____________________________________________

I could be way off on this as I'm new to actionscript.
Any help would be really appreciated.
:r::

Passing Variables Between MC's
Hello everyone. I cannot seem to pass a variable from one MC to another. I have a text field in one mc with a variable name of myname. Then I am trying to get a text field in another mc to get the data inputed into the text field located in the first MC. Ths code I am trying to use which is located on the first frame of the second MC is:

newtextfield=_root.mc1.myname;

what am I doing wrong?

Passing Variables
I am reading a file location from an xml string and placing it into a variable, which seems to work fine

m_DataFile = 'File:\' + x_Setup.attributes.DataFile;

I then try to use the variable in the xml.load() method and it does not work.

m_xmlDoc.Load(m_DataFile);


However, if I hardcode the m_DataFile with a string, the load works correctly.

m_DataFile = "File://C:\development\XMLSchedResults\Indian Wells\TournamentFlash.xml";


What am I doing with the xml that is making the Load method think that the variable is not a string.

Passing Variables
i have a timeline with a few dynamic text-fields with variables. i also have an extra movieclip placed in this timeline and want the text-field-variables be passed into that movieclip so they can be displayed in it. how can i do this? how can i "load or pass" these text-variables into a certain movieclip and other timelines?

thanx for any support from germany
martin

Passing Variables Between .swf's
I'm trying to make an .swf that pops up & displays the percentage loaded of another .swf outside of the movie.

So how do I pass variables between two .swf's that are running?

is it possible?

I'm sure this is probably the nth time someone has asked this.

Passing Variables
Anybody know how to pass variables from one flash movie to another! I have a serious of 21 seperate flash files with volume controls. When the user switches to the next flash file I want to pass a variable to the next movie to tell the volume to stay at the same level. How should I go about doing that?/

Thanks
Caleb
http://www.e-simpson.net

Passing Variables From One Swf To Another Swf
hi guys,
how can i pass variables and values from one swf to another swf, pls help me

thanx in advance

Passing Variables Between MC
Well, I have this script that spouse to send a variable from a movie clip to another:

// this code is right after grapping the information from an asp file to generate a menu

for (i=0; i<product_length; i++) {

duplicateMovieClip(product, " product" add i, depth);
setProperty("product" add i, _y, yposition);

set("product" add i add ".info", product_array[i]);

tellTarget ("product " add i) {
product _lnk = "myProduct" + product_array[i];
}


depth--;
// Set the y position plus 30
yposition = yposition+20;
}


on the target movie clip I got this script:

on (release) {
getURL("myasp.asp?var=" add product_lnk );
}

NOW, when I test the code I get only the text part of the variable which is “myProduct” and that ‘s it, I’m not sure what am I missing here.

The idea is to generate a dynamic menu from the database using asp and each item in this menu has a different value that already pulled from the same database, think about it as you want to create a dynamic online product broacher where you create one asp page that displays a product using it’s id, but this time I’m trying to use flash

Any help will be appreciated

thanks

Passing Variables Via Url
I am trying to pass a variable into flash and for some reason it is not working correctly. Here is what I have so far.

OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c
ab#version=5,0,0,0"
WIDTH=732 HEIGHT=158>
<PARAM NAME=movie VALUE="aboutmain.swf?toggle=1">
<PARAM NAME=quality VALUE=best>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
EMBED src="aboutmain.swf?toggle=1" quality=best bgcolor=#FFFFFF WIDTH=732
HEIGHT=158 TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_
Version=ShockwaveFlash"></EMBED

and in flash:

if (_root.toggle==1) {
gotoAndStop("end");
}


but the movie is playing all the way through... am I missing something here....

thanks

chewey

Passing Variables
is anyone there that can explain me if and how it's possible to send a variable from a movie flash to another?? The two flash are located into the same page but they're not nested.

tia
Giano

Passing Variables Around In A .swf
Hey people,

i have done some searches over flashkit and the net to search for some tutorials, but i did not find anything.

This is my problem:

--On stage in one of it's frames i have a variable named let's say (COUNTER = "0")

--Then i have a movie clip that plays 100 frames. At the end of that 100 frames i have a script in a frame that tells (COUNTER = "0") to have a value of "1"

--And on the stage and in the movie clip i have a dynamic textbox that shows me the constant value of that variable showing me wether the variable in the movie clip and or on stage is effected.

When the animation is done it does not add the value to the variable on stage. I have figured out that only the variables within the movie clip are effected and what is on stage is not.

is there some kind of line that says "Add "1" to the variable on stage from within this movie clip"?

if there are any tutorials you people can give me that will be amazing.

Thank you
Filosofer

Passing Variables Between 2 Mc's
Hello!

I've got an fla containing 2 movieclips. Now how do I pass the values of the variables of MovieclipA to MovieclipB?

Thanks in advance,
---va

Passing Variables Across SWF's
Hi there...

I need to pass a variable (location) between swfs. I am using MX...

First I have a button on my main movie... it loads a swf using the
following:

on (release) {
if (location == 0) {
location = 1
loadMovieNum("../flash/contact.swf", 2);
}
}


Now, I want the loaded swf to do something based on 'location' being either
1 or 0. Here is the code I am trying to use on frame 1 of 'contact.swf':

if (_root.main.swf.location == 1) {
location = 1
gotoAndPlay("frameWait");
}
else {
gotoAndPlay("frameGo")
}


Can anyone see what I am doing wrong here? I can't figure it out.

Help much appreciated,

Cheers
Joe

Passing Variables?
Hey,
I have an animation I want to play then send you to another page...how can I pass what page I want the flash animation to go to after the tween?
EX:

Home button, Members button, link button

When you click members...a little banner comes out via a tween. When I click one of the other 2 buttons(home, link) I want the tween to go in reverse, and put the user at the page they selected. Know what I mean?
Thanks,
Josh

Passing Variables?
So I'm a relative noob at action scripting, so sorry if this is a lame question.

All I want to do is have some buttons on my main timeline set variables that are then used by actions on a movieclips timeline.

I set the variables, and when I trace them at the source (i.e. buttons actions) the trace prints the correct variable.

However, when I do the same trace in the movieclip actions where I want to use said variable it comes up undefined.

I am not using "var" to define my variables so they should be global right? Thanks in advance.

Passing Variables
hello,

i am trying to write script that will read a number of text files specified by the designer. how can i make it simple for him? is there a way that he can just save a text file with that number in it and i can read it in as a variable? thanks!

brian

Passing On Variables
I am trying to program a little bit with actionscript and have been running time and again into the following problem:

Is it possible to pass on the value of a variable from the main movie to a movie that has been loaded with the load-movie statement (or getURL for that matter)?
If so, how is it done, or where can I find how it is done?
I have tried the "send variables"-option (both Post and GET) but to no avail.

Thanx,

Paul

Passing Variables....
OK, here is what I would like to do....and I'll try to explain it as explicidly as possible. I would like to create a flash website/.swf file with a simple numerical variable that, when a user pushes a button, not only does the user go to a linked website, but my numerical variable will also be passed to the linked website and be automatically entered into one of several form fields already 'defined' or there.

Hope that makes sense.....and anyone got some ideas?

Thanks loads guys,

Craig

Passing Variables
I've never had this problem before, but for some reason I can't get the variables to pass from the php page to the flash movie and back out again.


I've made one of those annoying flash pop-ups with an invisible background. The swf is in a layer. when you click on the movie, it sends you to another page.

the php page contains this:
embed src="popup-girl.swf?selected=<?echo $selected?>"


the first frame of the movie looks like this:

stop();
selected = selected;


the button that sends you to a new url looks like this:

on (release) {
getURL("main_sessionlogin.php", "_parent", "GET");
}



i'm sure I've made a mess of things, but I can't figure out why it doesn't work.

It goes to the page ...whatever.com/main_sessionlogin.php?selected=

but it should be ...whatever.com/main_sessionlogin.php?selected=something

Passing Variables Into AS
Hi guys, I have .asp file with passing this value

numTextElements=5
text1=hello
text2=my
text3=name
text4=is
text5=joe

I need to create file called TextControll which will loadVaribles from .asp, then based on the value of numTextElements, it will load one of the following:

taglines5.swf
taglines6.swf
taglines7.swf
taglines8.swf

and it will pass the text variables to the taglines movie.

Guys if you can help me with this I will be greatful.

Thanks,

zmilosevich at rogers.com

Passing On Variables
Is it possible using Flash 5 to pass on variables when loading a .swf into a another. i.e if I have a user opens a movie and types in their name and then a movie is loaded into that for their name to be displayed.

-Anthony

Help With Passing Variables
I can't seem to get these variable names to pass properly. Attached is the .fla of a simplified version of what I'm trying to do. Basically, I have set up global variables that I want to change depending on which button is pressed. Those variables are then used as the names of the movieclip I want to start playing. Here is a quick and easy breakdown of what should happen...

1) user clicks on button 2
2) variable called "nextSection" gets assigned the value section2 (which is also the name of the movieclip containing the content for section 2)
3) the clip that is currently playing ("nowPlaying") gets told to animate out (nowPlaying.gotoAndPlay("close")
4) nowPlaying animates out and when it's done, it calls an action that tells "nextSection" to start playing.

somebody please help me...i have no clue why this doesn't work!!

Passing Variables From SWF To ASP
I am sure this is very simple. But i am stuck.
I am trying to pass the following via a button in my swf.

myListing?RealtorID=<%= Session("RealtorID") %>

Problem, the swf is not getting the session variable. I am currently sending it as follows:

on (release) {
getURL("linksPage.asp?RealtorID=<%=Session("realt orID")%>", "", "POST");
}

If this link was put on an link on html it works.... anyone please help.

Passing Variables
i have movie with 2 movies loaded into it.
first is a movie called "menu" -- loads jaccets.swf with the variable i need to pass to seccond movie called "order" that loads order.swf with textbox "order". i need this text box to get the var from jackets.swf.

how ?????
using mx

thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved