Passing Actionscript To Different Movies
I have a page split in to frames. Header frame which contains the navigation swf. Then a left bar which will holds the other flash movie and the mainframe which will hold the html content.
In my navigation I have 6 buttons. In my movie I have 6 different sections corresponding to the buttons. So what I want to do is when a button is clicked it will play the animation in the swf in the left frame and display the html. When another button is clicked I want it to play out the timeframe and then jump to the section in the timeframe that corresponds to the navigation and also display the html content in the mainframe. I was told to use _telltarget? Can someone help me out please.
Thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-27-2003, 12:03 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Passing Variables Between Movies
hey all...
i am a programmer who is new to flash and i am pretty confused about scoping of variables. the immediate problem is as follows:
we have a main movie which calls another movie. the user can then select somethings in the sub-movie. we want to write those choices to a variable in the main movie. the movies are separate to keep the size of the main movie down.
is there any way for movies to share variables other than using text files and a load varaibles call? we tried using javascript and cookies (an ideal situation) but had trouble with ie om mac (we will need to use the setvariable call rather than using javascript to write the page and reloading it).
i am sort of new to flash terminology, so i trying to be as clear as possible.
thanks in advance!
og
Passing Variables Between 2 Movies
I need to pass a single variable from one flash movie to another. they are both on seperate html pages. I have done this before using ASP and I know it can be done with most other backend languages too. The trouble is I am limited by the clients crap intranet.
I have html, flash and javascript at my disposal. Anyway it can be done?
Passing Info To Movies
hi all,
could anyone please please please tell me how to get this done?
i have a main movie interface which loads other movies into it using the load movie-target action. now, what i would like to know is how do i pass variables to the loaded movie and then pass info back to the main movie from the loaded movie. is this even possible? i'm losing too much hair figuring out what to do.
so, pls let me know. i would be eternally grateful.
thanks in advance.
Passing Variables Between Movies
hello fellow flashers,
In need of your wisdom, yet again.
I want to declare a variable which can be accessed in another movie. I have a movie loading in an MC. In that movie there is a link to another movie, which has several sections. I want to target a specific section. This is what I have on the link in the first movie:
on (press) {
_global.section = "sales";
gotoAndStop(27);
loadMovie("investor.swf", _root.dropmenu);
}
Then in the investor.swf (the movie with all the different sections), I have in the frame action:
if (_global.section eq "sales") {
gotoAndPlay("sales");
}
Nothing happens.
I hope this is enough info.
Thanks in advance!!
Passing Info Between Movies
Ok I'm not entirely sure how to do this, hence posting this.
But basically I have a a main movie which uses buttons to load several other movies.
What I want to do is get some text in the movie that is being loaded and pass it back to main movie.
I guess I will need a dynamic text box in the main movie but I'm not sure the commmand / code to use.
Any help would be greatly appreciated
Variable Passing Between Movies
Hi,
I want to send a varibale from the current movie to the new movie that I am loading, with the Load movie command. It is not a web based, so using Get or Post methods have not been successful.
Please email me at khushru_kanga@hotmail.com if u have know how.
Thanking you,
Khushru
Passing Variables Between Movies
Hi
I have one EXE Flash file and one SWF file... I call the second one from the first one... I'd like to pass variables from the first to the second without using text files... how is that possible? I hope that's clear!
nico
Passing Variables Down Through Movies
So, I'm creating an interactive test.
9 categories, 15 yes/no questions in each category, with total scores (yes's) for each category grouped together (in a separate movie) at the end of the test.
I've made it so that for each category, the number of yes's the user clicks gets totaled in something called "categorytotal"
To limit the stress of download, I've created separate swf files for each category (each question is accompanied by a vocal soundbite, which takes up a lot of room if put into only one file). Somehow, I have to get the "categorytotal" from each separate movie to move on to the final movie in which all totals shall appear.
Basically, the user has to see all of their totals gathered at the end, and somehow, their entries (variables) have to be passed along.
How would I do this?
I'm using LoadMovie to load in each successive swf/category of the test. In the Variables box, I've tried out POST, hoping that this would somehow pass on the new total for a variable such as "musictotal", so that it could eventually be passed on down to the last movie. Do I need to use LoadVariable, too?
Can this even be done???
Any help is greatly appreciated!
Thanks,
Shak
Passing Variables Between Movies
Is using globals the best way of passing variables from an already loaded movie to a new movie being loaded, or is there a better way? If so, what is it? Tks
Passing Variables Between Movies
Hi,
I'm loading movie2 into movie1 and want movie2 to use a variable I have set in movie1. I thought it would be recognised as a global variable but it doesn't seem to work.
anyone any ideas?
cheers!
Tammy
Passing Variables Between Movies
Hi
How can i pass variables between movies like:
nome="Tavares";
Cod_Delegacao="Coimbra";
If i do
loadMovieNum("despesas.swf?Nomes="+Nome+"?Cod_Dele gacao="+Delegacao,1);
don't work (for the variable Cod_Delegacao). How can i do that?
Thanks
Mario
Passing Variables Between 2 Movies
Hi,
I have 2 separate flash movies on one html page. Effectively there is a menu movie and a display movie. I would like the display movie to react (on mouseover) of the individual menu components.
I have done a fair amount of research on this so far and can not find a simple solution. Perhaps it is too simple and is staring me in the face. Surely there is a way to pass variables from one flash movie to another?
Your help is VERY much appreciated,
Best regards,
Tony
Passing Variables Between 2 Movies
Okay, this question is fairly simple, but for the life of me I can't figure it out. I'm feeling rather dumb, but it's been a while since I've tried this.
I have two movies on the same page and I need to pass variables between them without having to reload the page. How do I do that?
Thanks!
Passing Variables Between Movies
ok, I have five swfs in different pages but on the same site. One of them is the main swf that is always open (the other four are beeing opened and closed all the time). What I need is to know how to make the 5 swfs be exchanging variables all the time, in my last try I could only make them oad the variables once, then they wuldnt change again.
Passing Information Between Movies
I have found many posts about passing information between movies on this very informative board, but none that directly relate to my problem.
I have a shell movie that uses loadMovieNum("secondmovie.swf", 1) to load another movie. What I am trying to do is stop my shell movie's timeline until the other movie is loaded (using a preloader), then have the shell start playing again. Any suggestions on the correct code to use?
Passing Movies OnRelease
hey im using the following code for my main four buttons -
Code:
button_array = ["home","plans","terms","contact"];
for (var i in button_array){
this[button_array[i]].onRelease = function() {
_root.fromName = 0;
content_mc.gotoAndPlay(36);
_root.fromName = button_array[i]+"_mc";
};
}
but every button restarts the home_mc clip..
i call it like this in the content_mc clip -
Code:
stop();
attachMovie(_root.fromName, _root.fromName, 1);
it also gets removed due to a slide down menu refresh everytime a button is pressed.
SO i have no idea whats going on
Passing Data Between .swf Movies.
http://vhektor.com/myoctopus/
Go to 'More Info' and click "Try It" (The leftmost option)
A map of the US comes up and users will select where they work, before getting to the next page, which is a form where they fill out the rest of their contact information. The Submit button sends the form variables to a php file on a different server which then stores their info in a database and will take the "location" variable from the map (in the previous .swf) to send the user the correct demo map.
My vars from the form post to the PHP and a confirmation e-mail is sent to the user etc. etc. this works fine...i'm just confused as to how to send the location variable that was pre-selected to send along with the form.
Thanks!
Passing Movies OnRelease
hey im using the following code for my main four buttons -
Code:
button_array = ["home","plans","terms","contact"];
for (var i in button_array){
this[button_array[i]].onRelease = function() {
_root.fromName = 0;
content_mc.gotoAndPlay(36);
_root.fromName = button_array[i]+"_mc";
};
}
but every button restarts the home_mc clip..
i call it like this in the content_mc clip -
Code:
stop();
attachMovie(_root.fromName, _root.fromName, 1);
it also gets removed due to a slide down menu refresh everytime a button is pressed.
SO i have no idea whats going on
Passing Parameters Between Movies
I've got a movie with a load of parameters passed into it (using FlashVars).
It replaces itself with another movie, using the "loadMovie" command:
CODEloadMovie("../movie2/movie2.swf", this);
Passing Variables Between Movies
I have two .swf flash movie files. I plan to distribute these movie files on a CDROM. I want to know how I can pass dynamic variables between these two movies
Passing Variables Between Movies
I have a login movie on a pre-homepage, after you've logged in via a database it opens the home page. Is there any way to pass the variables from login to a new movie on the home page?
I could use the database again, but this might present a problem if there are multiple users. What exactly does getURL pass when you use the post variables argument? Could you make the home page an asp, then send variables from the login movie using getURL with homepage.asp and then somehow get at those with a movie on homepage.asp?
Passing Variables Between Movies.
I have a button in one movie with the following script on it:
on (press) {
loadMovieNum("raygun_2.swf", 0);
_global.firstAction = "with (_level0.ScrollBarAbout.scroll) {_y = 14;}";
}
on (release) {
unloadMovieNum(0);
}
It needs to unload itself and send the variable "firstAction" which contains the command :
with (_level0.ScrollBarAbout.scroll)
{_y = 14;
}
to the newly loaded movie "raygun_2.swf" which then needs to execute the "with" action to take the user to an "anchor point" within a text box.
I have tested the "trace" action and it seems to be sending the variable but I can not get it to execute the "with" action contained in the variable.
How do I tell the newly loaded "raygun_2.swf" to execute the action contained in the variable???
Passing Variables Between 2 Movies
I have two movies. I load one of them in the main movie. The secondary movie has a button who has to change the text in a dinamic text box, something like this:
on(release){
_root.form.data1.text="mytext";
}
Where form is a movieclip in the main movie and data1 is the dinamic tex box.
This is what i´m doing but doesn´t work, can you help me?
Slow Movies By Passing A Parameter
If i have an movieclip embedded in a webpage, is it possible to control the frame speed of the movieclip via a parameter passed from a form on that webpage?
Any comments appreciated
Passing Variables Between Flash Movies
Okay, after trying to sort through the hodge-podge of "tutorials" online, I stil can't find an easy way to pass variables between two different flash movies. Is there an easy way to do this without using PHP or ASP or anything like that?
Passing Variables To Loading Movies
using loadMovie or MovieClipLoader, how would i pass a parameter to the movie being loaded ?
the reason for this is that i'd like to have images dynamically and externally loaded
thanks
Passing Variables Between Two Flash Movies.
Problem:
I have 2 flash movies in seperate frames and I want to be able to pass a string variable from one movie to the other? Any suggestion would be greatly appreciated. Thanks
Passing Variables Between Two Flash Movies
I have three flash movies. Systems.swf, productDetails.swf, placeorder.swf
The first one (systems.swf) loads variables from an ASP page and loads nine records into the movie and displays everything I wan beautifully. for each record there is a button on the movie that says "more info" this button calls the second movie (productDetails.swf) it uses
loadMovieNum ("proddetails.swf", 0, "GET");
this page calls an ASP to get more details from the table on the selected system. It succesfully passes variables about the selected system to the second movie which in turn, passes it to the second ASP page and displays the the details of the system. On this move there is a button, to purchase the item. It uses the same
loadMovieNum ("placeorder.swf", 0, "GET");
to call the third movie. this is where the problem happens. the second movie doenst work. The screen goes blank, through troubleshooting Ive figured out that it doesnt get to the first frame of the third movie. its as if passing the variables the second time seems to kill the movie and it sits dead in the water.
Im using Flash 5 if it makes a difference. If anyone has any idea of whats going on please let me know.
Passing Variables Between Loaded Movies With Both Of Them On Level0
I have two movies, moviepart1 and moviepart2. when moviepart1 gets done playing and the user clicks on the "next" button it loads moviepart2 onto level0. I need to be able to have a back button on the first scene of moviepart2 to take the user to the last scene of moviepart1. Here is the actionscripting I am using:
This is on the back button on moviepart2:
Code:
on (release) {
jump=1;
loadMovieNum ("moviepart1.swf", 0, "GET");
}
and I have a wait scene at the beginning of moviepart1 to use a conditional to figure out if that variable has been sent or not. hereis that conditional:
Code:
if (_level0.jump == 1) {
gotoAndPlay ("scene3", 1);
} else {
gotoAndPlay ("scene1", 1);
}
I hope that this is enough information to get some help and I would greatly appreciate any help.
Thanks,
Justin
[Edited by therealsyko on 12-18-2001 at 11:20 AM]
Passing Variables From Dynamically Loaded Movies
Why can't Flash pass data from a dynamically loaded movie to the root timeline?
Here's the code in Frame 1:
_root.loc = "ABC";
//the Left Key traces the variable that is modified by the dynamic movieclip
userKey = new Object();
userKey.onKeyDown = function(){
if(Key.getCode() == Key.LEFT){
trace(_root.loc);
}
}
Key.addListener(userKey);
//the button dups the movieclip and loads a movie into it
_root.counter = 0;
bt1.onRelease = function() {
duplicateMovieClip(mct, "mct"+_root.counter, _root.counter);
loadMovie(counter+".swf", "mct"+_root.counter);
_root.counter ++;
};
Here's the code in the base movieclip (mct), that is duplicated in all sunsequent movieclips:
on(press){
nam = _name;
_root.loc = nam;
trace(nam)
trace(_root.loc);
startDrag(this);
}
on(release){
stopDrag();
}
Basically, I want to duplicate movieclips, load swfs into them, then identify which movieclip/swf has been clicked on, and pass its name to some scripts on the root timeline.
Note that if you comment out the loadMovie line - it works.
Thanks for your assistance.
Passing Variables And Values Across Multiple Movies
Hi,
I've got this code on a button in a clip called "topHeader.swf" within a parent movie called "mainMovie.swf"
Code:
on (release) {
_root.letsGo = true;
}
Now, I've got this code on this other clip called "bookingClip.swf" within the same parent movie.
Code:
if (_root.letsGo==true) {
gotoAndStop(1);
}
I'd love to know why it isn't working?
Any help would be greatly appreciated.
Blastbum
Passing Variables From Loaded Movies To The Loader Movie
I am loading a swf file into an empty movie clip in the main Flash program (mainApp). I am trying to pass variables by value from the loaded movie to mainApp.
This function is in mainApp:
function read_1_vars(band,qual, lang){
trace("--------------------");
blnBandwidth=band;
blnQuality=qual;
language=lang;
}
This is the code used in the loaded movie to contact mainAPP:
_root.read_1_vars(blnBandwidth, blnQuality, language);
All this code worked just fine when contained in one one single file.
Any ideas? What am I missing? Thanks.
Avoid Reloading Of Flash Movies When Passing Them Variables From Html
Hi all.
I've created a two-levels flash menu (mainsections each with subsections) which I am using as navigation in a html page. When I go to a different page, the html sends the movie a variable telling it to what section it should be automatically opened. Everything works fine except that when the movie receives a new variable it reloads from zero. Is there any way to avoid this without the use of frames?
Thank you very much.
Passing Actionscript.
Hi everybody.
Allright, i am creating a movie clip with the function createEmptyMovieClip but i am not able to pass actionscript into that Mc.
I try to use the attachmovie clip to put in the newly created movieclip, but when i use the attach function, i loose the code. I think, anyway that there is a better way to put some code in a dynamicly created Mc instead of doing an attach...
I just don't know what is the right solutions.
Need help and ideas,
Thx
Passing Javascript Into Actionscript
Hi everyone,
Is it possible to load a javascript variable into flash for use within actionscript. I wanted to use a variable from a javascript, would I use loadVariablesNum to pass it in? e.g
loadVariablesNum ("page.html", 0, "POST");
Passing Actionscript Commands
I am not sure how to do this or if it is even possible but...
I have a flash movie (for example sake we will call it movie1.swf), in that movie I have a button that will call movie2.swf by using the "loadmovieNum" command. So now movie1.swf is running with movie2.swf on top of it.
My questions is: What actionscript would be needed for movie2.swf to send a command to movie1.swf. For example if I wanted movie2.swf to tell movie1.swf to:
Code:
tellTarget('_root.main'){
gotoAndPlay(1);
}
Any help would be greatly appreciated.
Thanks
GET In Actionscript And Passing Variables
Is there such a thing as a GET command in actionscript? When someone clicks on a link I want to pass a variable into actionscript. I want to have a couple links that take the user to a different language translations of the current page. I would like the links to look like:
http://www.me.com/index.php?lang=french
and pass the lang=french into actionscript so the actionscript can load the french version of the page. How would I do this?
Passing Parameters To Actionscript
Hi,
I need to pass a parameter to my flash application from the html page. How would I be able to do it? And more importantly how would I read it with actionscript.
Thanks
Passing Variables Into Flash With Actionscript
I'm trying to pass in a variable from an .asp page into my main flash movie. I know that my .asp code is correct, but for some reason the data isn't getting passed. This is the code I use when the flash movie loads:
onClipEvent (load)
{
if (_level0.ViewOnly == "True")
{
loadVariables("GetGameData.asp", 0);
gotoAndPlay("Scene 2", GameData);
}
}
GameData should get passed in as "message1". This is the asp code I use to get GameData from the database:
<% strDConn = "DSN=*&^%^*; UID=^^^; PWD=XXXXXX"
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open strDConn
sqlStmt = "Select Param1 AS GameData FROM EventQueue Where SeqId=25;"
Set RS = Connection.Execute(sqlStmt)
GameData = RS("GameData")
Connection.Close
%>
I'm 100% sure that the SQL works. Anyone got any ideas?
-Stu
Passing <Param> Between Html And Actionscript
Hi, I have a little site that needs to pass a variable from html to a swf. I've read that this can be done using the Param in html, but I'm having a problem figuring out how to retrieve the variable in my actionscript.
Any help is appreciated!
Problem With Passing An Ideia To Actionscript
hi folks,
i'm having some problems with actionscript and i cant find a solution maybe you experts can help me out.
i'm developing a slot machine in flash, so i have 3 reels that choose values randomly. so far so good. my problem is that i cant alow to give an amout that i dont have, so i have a var called "caixa" that hold the amount of money that i have so far. i also have an array with the simbols combinations that give rewards (e.g. AAA on letter for each reel). so what i need the script to do is that well the user push a button the reels select random numbers and flash checks the amount of money avaliable, and if that amount is enought to any of the rewards if it is then he can just acept the values combinations with no rewards and the ones that have money to pay of. othewise it has to do a new random.
i cant pass this ideia to code, can any of you help me out?
Passing Variables To Actionscript File
Hi there
I have created an external actionscript file, which is called from Flash with the command
#include "my_script.as"
The question is: how can I pass variables from Flash to the external actionscript file?
Thanks
Hagop
Passing Variables To ActionScript CS3 From JavaScript
Hello,
I cannot seem to figure out what I am doing wrong and I need some help . Who better to ask than the experts right?
I have everything working correctly thus far except for this actionscript. I am using Flash CS3 with ActionScript CS3.
I have 5 buttons made up in flash.
I am attempting to do the following tasks
1. Make buttons with effects in flash - done
2. Put the correct button in the down position based upon the webpage that the user is on.
In order to perform this dynamically I apparently have to use 3 different languages, PHP, JavaScript, ActionScript.
I have been messing with this for a week and cannot figure it out. I have all of the rest of the scripts tested and verified working.
Here is the link to my test page
http://www.spectacularstuff.com/php-test/inprogress/php-url-detection.php
Here is all of my code for testing. (This doesn't include any buttons. This is just merely to test to see if I am passing variables.)
PHP Code to detect the filename.
<?php
function curPageName() {
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}
echo "The current page name detected by PHP is ".curPageName();
?>
JavaScript Code to pass the variables to Flash
<script language="javascript" src="swfobject.js">
var so = new SWFObject("php-url-detection.swf", "php-url-detection", "550", "400", "9", "#FFFFFF");
so.AddVariable("currentpage","<?php echo curPageName(); ?>")
</script>
ActionScript Code to get Variables from JavaScript and display them in flash.
// Dynamically Create Text Fields
var tf:TextField = new TextField();
tf.autoSize = TextFieldAutoSize.LEFT;
tf.border = false;
addChild(tf);
var tf2:TextField = new TextField();
tf2.autoSize = TextFieldAutoSize.LEFT;
tf2.border = false;
addChild(tf2);
//Create variable to write to page
var myStr2:String;
//first attempt at putting the variable onto the page.
//This LoaderInfo has to be capitlized. An error occurs if not.
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters.currentpage;
//second attempt at putting the variable onto the page
var myStr:String = this.root.loaderInfo.parameters.currentpage;
trace (paramObj);
trace (myStr);
if (myStr == null)
{
myStr = "Flash is not reading the variables from JavaScript. :(";
myStr2 = " ";
}
else
myStr2 = "Flash is reading the variables from JavaScript!! :)"
tf.text = myStr; //Display the URL onto the page
tf2.text = myStr2 //Display Flash is happy
[-- End of Code --]
Please help.
Thank you in advance.
Wayne
ActionScript Passing Variable By Value On Reference
It took me hours to figure our why this was returning the wrong value
// CODE Sample
function one(){
var test1 = Array();
test1["one"] = 1;
var test2 = test1
trace(test2.one); // output = 1 // this make sense because it gets the value from test1
test1.one = 1000;
trace(test2.one); // output = 1000 // !!!! this should be 1
}
one();
/// end CODE SAMPLE
From the example above You see that in Actionscript when assigning one variable to another it does it my reference not value. So when you chage the value of one array it changes the value of the other automatically.
I need to have the "test2" variable reference the "test1" array only by value so if modify "test1" the values of "test2" won't be modified.
If this is a setting to change this or a way to have the variable reference only by value this would be extremely helpful.
Thanks
KJ
[CS3] Passing Variables From Embed/Object/Actionscript In AS3
Hello everyone,
Apologies if this has already been asked - I'm at the end of my tether with searching help files/forums/tutorials.
I'm making a basic mp3 player for a website and I basically need to be able to pass different strings of URLs pointing to mp3 files to the player.
How do you do this in AS3? I get the feeling that the object code is just <param name="mp3" value="mymp3.mp3" /> but then what do I add to the Actions script to be able to read that parameter?
Thanks
Edd
|