Global Values (i Think)
hey i think my problem concerns global values, not sure, maybe someone can help.
ok i have draggable mcs arranged in 6 large mcs.
these draggable mcs can be made visible/invisble.
this is done by changing values in dynamic text boxes thorugh buttons,
the script im using is pretty basic:
code: on (press){ if (var1 eq "1") { pt1._visible = true; but1._visible = false; chek1._visible = false; } else { var1 eq "0"; pt1._visible = false; but1._visible = false; chek1._visible = false; } }
ok so when the "ok" button is pressed it checks what the dynamic text value is and hides or doesnt hide the draggable mc "pt1"
the problem im having is that "pt1" is inside another mc named "page1"
so do need to set a global name for the mc "pt" or just alter my script incorporating "page1" somewhere??
hope this helps and that someone can help me!!!
cheers
dave
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-16-2004, 06:47 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Global Variables Values?
Did anybody knows how can I use variable values
from parent or child movie, or set them
on some global variables.
I tried with path where they are set in parent movie,
but it doesn't work.
Tnx in advance
Cash
Flv Player , Passing Global Values
hello people,
am trying to build an flv player ... i did it it is fine for now .. but what i still need is to make it auto play ..
i do call my swf from a vb6 application and i pass the movie url to it and save this url in a text area on my swf file .. now i want eveytime i pass this value to to play it automaticlly..???
here is my code ... hoping that anyone can help .. and hoping that am clear enough
Code:
_global.Movie;
_root.onEnterFrame = function () {
ro.text = Movie;
};
ro.visible= false;
var nc:NetConnection= new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(10);
ns.onStatus=function(info){
if (info.code=="NetStream.Buffer.Full"){
bufferClip._visible=false;
}
if (info.code=="NetStream.Buffer.Empty"){
bufferClip._visible=true;
}
if (info.code=="NetStream.Play.Stop"){
ns.seek(0);
ns.pause();
}
}
theVideo.attachVideo(ns);
rewindButton1.onRelease= function(){
ns.seek(0);
}
playButton.onRelease= function(){
ns.play(ro.text);
}
var videoInterval= setInterval(videoStatus,100 );
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"]= function(obj){
duration=obj.duration;
}
function videoStatus() {
amountLoaded= ns.bytesLoaded / ns.bytesTotal;
loader1.loadbar1._width= amountLoaded * 208.9;
loader1.scrub._x=ns.time / duration * 208.9;
}
var scrubInterval;
loader1.scrub.onPress= function() {
clearInterval(videoInterval);
scrubInterval= setInterval(scrubit,10);
this.startDrag(false,0,this._y,201,this._y);
}
loader1.scrub.onRelease = loader1.scrub.onReleaseOutside= function() {
clearInterval(scrubInterval);
videoInterval= setInterval(videoStatus,100 );
this.stopDrag();
}
function PlayMovie() {
ns.play(ro.text);
}
function scrubit() {
ns.seek(Math.floor((loader1.scrub._x/201 ) * duration ));
}
Set Global Variable Values With A Loop
I am trying to create a loop that will set a variable's value equal to a global variable's value.
for(i=0;i<=3;i++)
{
this["somevalue"+i]=this[_global.field+i];
}
so that it would output
somevalue0=_global.field0
somevalue1=_global.field1
somevalue2=_global.field2
somevalue3=_global.field3
etc...
Can this be done? I seem to be having trouble joining the global variable with the variable i, this["somevalue"+i] part works ok. Outputing a javascript message with the global variable shows an empty message box.
Accessing Global Variables Values In Different Scenes
I have a movie with 3 scenes, and I am wanting to check variables on the various scenes that are set when the scene loads.
For example, on scene 1, I set a global variable: "varScene1 = 0", on scene 2 I want to place a variable check to see if the variable varScene1 is still 0, like this:"if (varScene1 != 0) {}". How do I reference the value of the variable that is set in the scene? Also, if I have a movie clip that has the variable check in it, how would I tell it to get the variable from the current scene that the movie clip is in.
Hope this makes sense.
Thanks,
Jeff
Global Variables Values Change Spontaneously
I am currently making a quiz/board game. There is a "Take question card" button which goes to a random frame in a specified movie. Every frame in that movie has a question with answers that make the players advence on the board. The problem is, I need to make sure that once a question has appeared and been answered, it can't pop up again. I thought about declaring a global variable for each question ("_global.q1" for question 1, and so forth) in frame one of the root movie with a value of "0". The answers to each question will then, additionally to moving the pieces on the board, change the variable's value to "1" (on(release){_global.q1 = "1"}). And, directly in each question's frame of the question container movie, I made an invisible movie with the script below, thinking that the first time that frame loads the variable must be set to 0, so the question will load normally; and afterwards, since the answer set the value to 1, the script below will go to the next frame. Thus, no question is repeated.
onClipEvent (enterFrame) {
if (_global.q1 = "1") {this._parent.nextFrame()};
}
However, on testing the movie, I press the button with the gotoAndPlay(random()) and all my variables values set to one, taking me all the way to the last frame in the question containing movie.
Setting Variables And Values, Are They Global Or Specific To Movie
Hello
I am using Flash MX, I am not a programmer but would like to one day... I am attempting to do some simple programming in Flash MX... never have programmed before other than simple action script stuff..
My question has to do with nested movie clips and setting variables.
On my main stage I have a movie clip (buttonclip)... inside of it there are 3 buttons...... Animation, Construction, and Tour.....
When someone clicks on one of these buttons I have set the variable called SubNav....
when someone clicks on Animation I set the variable and value to SubNav = "ani";
For Construction SubNav = "const";
For Tour SubNav = "tour"
In another movie symbol on the main stage (navigateto)... I have several keyframes and lables set up with a stop action on each keyframe....
There is a keyframe for Animation, one for Construciton and one for Tour.
In this movie clip (navigateto) I want to put in some action script basically saying
If SubNav="ani"
Then GoToandStop Keyframe Animation
My question is this... since the variable SubNav is being set and given a value in a different movie clip (buttonclip) will the value be transferred into the moviecip (navigateto)
In otherwords will this variable and its value apply to all movie symbols on the stage and nested movies... or do you have to specify a path somehow with instance names?
Please help
Thanks
ExtraB
PROBLEM: Retrieve Values From ASP, Then STORE Them As Global Variables In Flash
Hi,
I'm trying to retrieve some values from an ASP page, then store these values as global variables in Flash. I cannot get this to work.
ASP:
Code:
<*%@ Language=VBScript %>
<*%
Response.Write "&baseURL=http://www.someURL.com"
*%>
This works in Flash:
Code:
fileNames = new LoadVars();
fileNames.load("getFileNames_test.asp");
fileNames.onLoad = function(success) {
if (success) {
_root.baseURL = fileNames.baseURL;
trace(_root.baseURL);
}
}
This DOES NOT work in FLash:
Code:
fileNames = new LoadVars();
fileNames.load("getFileNames.asp");
fileNames.onLoad = function(success) {
if (success) {
_root.baseURL = fileNames.baseURL;
}
}
trace(_root.baseURL);
I need to set the variables OUTSIDE of the function. Why does it not do this? I thought that one uses var to temporarily declare a variable in a function but I'm not using var.
HELP PLEASE. THANKS.
Generating Random Values For A Variable While Excluding The Already Generated Values
Hey Flashers:
Here's my question this time around. I want to generate random values between 1and 50 for a variable but I want every time I generate the new value to exclude the already generated values from the pool of options. Something like playing the lottery where no two drawn numbers can be the same. Any hints or references to open code will be greatly appreciated.
As always, thanks a lot!
Function Populated By Node Values Returning Undefined Values
I have been working on some code which extracts the information from an xml document, styles it with css and then loads the various node values into a text field and arrays. The user click on a link in the text field which calls myFunction using asfunction and that in turn should enter the array values relating to that link into text fields.
Everything in general seems to work OK except the value that is returned to the two text fields on pressing the link in the CCTextField "which in turn calls myFunction" returns undefined for those values of the arrays. I check the agency[2] value in the function that populates the arrays and the value is returned as it shoiuld be so it appears there must be something amiss with myFunction, or at least it would seem so.
Any takers as to what this problem might be?
I have supplied some shortened code below.
PHP Code:
CCTextField.styleSheet = myStyle;
// NOTE: CCTextField styleSheet has been created beforehand
my_xml = new XML();
// NOTE: my_xml has been created beforehand
my_xml.onLoad = function(sucess) {
if (sucess) {
processXML(my_xml);
}
};
// Load up the XML file into Flash
my_xml.load('TEST.xml');
// This is the function that will be called when
// the XML document is loaded succesfully
function processXML(xmlDoc_xml) {
var listText_comm = ""; // List text variable
var entryNum = 0; // Entry number variable
var agency = new Array(); // Agency array
var production = new Array(); // Production array
for (var n = 0; n<xmlDoc_xml.firstChild.firstChild.childNodes.length; n++) {
categoryNodeName = xmlDoc_xml.firstChild.firstChild.childNodes[n].nodeName;
if (categoryNodeName == "client") {
listText_comm += "<a href='asfunction:_root.myFunction," + entryNum + "'>" + xmlDoc_xml.firstChild.firstChild.childNodes[n];
trace("client " + xmlDoc_xml.firstChild.firstChild.childNodes[n]);
} else {
if (categoryNodeName == "title") {
listText_comm += " - " + xmlDoc_xml.firstChild.firstChild.childNodes[n] + "</a>";
trace("title " +xmlDoc_xml.firstChild.firstChild.childNodes[n]);
} else {
if (categoryNodeName == "agency") {
agency[entryNum] = xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue;
trace("agency " +xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue);
} else {
if (categoryNodeName == "production") {
agency[entryNum] = xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue;
trace("production " +xmlDoc_xml.firstChild.firstChild.childNodes[n].firstChild.nodeValue);
entryNum++; // click over the entry number by 1
}
}
}
}
}
trace("AGENCY 2 = " + agency[2]); // this returns agency number 2 OK
_root.CCTextField.text = listText_comm; // CCTextField shows this text OK
}
function myFunction(listItem) {
clientF = agency[listItem]; // THIS RETURNS undefined ON PRESSING THE LINKS IN CCTextField
productionF = production[listItem]; // THIS ALSO RETURNS undefined ON PRESSING THE LINKS IN CCTextField
trace(listItem); // this trace = the list item passed by asfunction OK
}
[MX] Weirdness With Values Used By Array Populated Clip Values.
Hi,
I have used invisible buttons on top of some text, as part of a volume control interface.
The text buttons are set out as 0 – 25 – 50- 75 -100 referring to the % that a music tracks volume will change to once a button is pressed – so far so good.
Now to give values to the text buttons in order for them to make the text clip that they are on top of go to & stop & the right frame I have used arrays to give a reference the location of the text clip:
numbs_array = [_root.volHold_mc.vol0, _root.volHold_mc.vol25, _root.volHold_mc.vol50, _root.volHold_mc.vol75, _root.volHold_mc.vol100];
I then reference that in a home made “release” function as “this.monica.gotoAndStop(2);” “monica” being the reference to the address of the clip.
It all works fine except the code seems to make the movie play clips in an order that they have not been designated in the array – Like a button on top of the “25”% value will play the animation for the “75”% clip?
The whole problem is probably much better seen through the movie – the problem section of which i have attached below.
[CS3] Global Function = Global Variables As Well?
CS3/AS2
if i have a global function with some variables defined within it, are the variables global too? if not how would i make them global too?
_global.function someFunction() {
var cake = 10;
var book = 15;
}
someFunction is global so therefore "cake" and "book" are too?
Global Function, Global Variable
how to declare global function and global variable? if i declare it just in frame 1, then the object in other frame can reach it? thanks for answer..
Passing Values From ASP To Change Alpha Values Etc
Is this possible? I currently have a log in system, logging each page a user visits, these visits amount to a value and have this value passed to flash to control alpha values, tints etc to reflect look and feel. is this possible?
Database Values To Array Values
Hi all,
I've created a movie which uses a number of arrays to construct the elements of a flash-based gallery.
What I need is a practical method of getting values from a database into an array via an ASP page.
The plan was to load the variables into these arrays using the an asp page and a loadvars object to create a string (basically the array values in quotes separated by commas) which was then to be inserted into the parameters for the creation of the array. Needless to say this hasn't worked- the create array object seems to interpret the whole string as the first value in the array, i can't find a way of populating the array from just a single asp page.
I've given up with this method and really need a few pointers.
Thanks
Are Global Variables Really Global?
Hi everyone!
This might sound like a dumb question, but i've just been struggling with variables (more specifically global variables) for the last 3 hours, and now that i made it work, i'm wondering if my solution is the "normal" one.
From what i gather, when you declare a _global variable, you can just use it from any timeline without using a path, right? I have a variable (whichHoliday) which i initiate in the first frame of the main timeline, this way:
_global.whichHoliday="";
I want to give a new value to this variable inside a MC on that timeline. The only way i could do it was by using:
_global.whichHoliday="whatevervalue";
Shouldn't i have been able to use only: whichHoliday="whatevervalue" ?
Why did i need to use _global again to set the value?
Thanks for any input!
[F8] My Global Variables Are Not Global
Hi
I have a problem, my global variables aren't global, as soon as a new timeline is entered the global variable is undefined. (I read somewhere in a forum that it is only possible to use a couple of global variables for F8, could that be correct?)
I use:
if (_global.thing == true){
thing._visible = true;
}
This works for the timeline where true was set and one more timeline, but as soon a third timeline is entered the global value is set to undefined!
What could be the problem?
I am soo grateful for any suggestions!
Thanks!
My Global Variables Don't Seem So Global
what the hell am i doing wrong!?
heres what i've got:
in my UI class i have this:
#include "ContainerClass.as"
#include "MapClass.as"
#include "ObjectiveClass.as"
#include "SponsorClass.as"
#include "MeasureClass.as"
#include "InitiativeClass.as"
#include "AnalystClass.as"
#include "MilestoneClass.as"
#include "StoryLineClass.as"
#include "CommentsClass.as"
var dbPath = "localhost";
_global.scriptPath = "http://"+dbPath+"/strategymap/scripts/";
then in all of the included files i have something like:
myloadvars.sendandload(scriptPath+"/filestoload.whatever",x,"POST");;
sometimes i just want to break something. grrrrr!
Writing Values To A Text File And Reading Values From The Same File
Hi, I want to create a page counter in Flash and I was wondering how to write a value (the next number for the visitor) to the text file and read the current value from that file. In a simplified form I would just read the number currently in the file, add 1, and rewrite the number to the file. Eventually when I get that worked out I will adapt it to only add 1 for each different user session instead of each page hit, but I'll start with the easy stuff first.
Thanks
Global
Can I use Global variable in action script ?
thanks
Guillaume frechette
Global?
Hi!
Just read an article on actionscript coding standards and came across this: what is _global exactly, and also, when to use _global, _root or this. Really confused about which should be used and when =P
Another question is about playing midi files. Is there a way to sort of use quicktime plug-in to play a midi file in sync with a flash movie, and to control the plug-in from within the movie, i.e., change the music file when a scene changes?
Thanks ^_^
Russ.
Global
O.K. I need help plez! I am trying to make a game but i need help. I need a variable that can be used in main timeline and movie clips, so... I put a _global. in front of the variable def.
_global.score = 0;
.....but now, my dynamic text reads
"level0.score"
I checked everywhere, but still have no clue how to fix this, please help!
Thanx
Global
O.K. I need help plez! I am trying to make a game but i need help. I need a variable that can be used in main timeline and movie clips, so... I put a _global. in front of the variable def.
_global.score = 0;
.....but now, my dynamic text reads
"level0.score"
I checked everywhere, but still have no clue how to fix this, please help!
Thanx
Global
Is there an official place to put global variables and functions; I usually put this stuff in 1st keyframe actionscript.
[CS3] Global Var?
I have the following button that sets the var itemType:
button.onRelease = function():Void {
itemType = "yes";
}
But when I set the itemType using the button I want it to be used outside of the function, how can I get it to intiate a piece of code and use the itemType set by the button?
Global MC?
Is there such a thing? Because I'm loading an external .swf into a movie clip and the flash progresses onto the next scene, I was hoping that I could keep the frame at the same position as before the scene change.
Is this confusing or do I have to pass the _currentframe properties to a variable and tell it on frame 1 of the next scene to go to that frame again, causing a break in the flow of that mc?
Any idea's?
Global Var
Can a var be set as global for use by all functions in a single fla file?
I would like to set a var in any one of 3 functions (dependant upon user choice) and then be able to read it's value in a fourth and fifth function.
something like this:
//----------------------------------------------------------------------------------------------
public var choice1
function onechoice() {
//do something
//set choice1 value
choice1 = "one"
allchoice()
}
function twochoice() {
//do something
//set choice1 value
choice1 = "two"
allchoice()
}
function threechoice() {
//do something
//set choice1 value
choice1 = "three"
allchoice()
}
function allchoice() {
if (choice1 !=undefined){
checkchoice()
}
function checkchoice() {
//do something
//set choice1 value
switch (choice1) {
case "one" :
//do this
case "two" :
//do this
case "three" :
//do this
}
//end checkchoice
}
//--------------------------------------------------------------------------------------------------------------
Is this possible?
Global CSS
hello,
i have something like "3-level" depth project of .swf movies loading into the main .swf.
i have one CSS style in root of the main .swf
----------------------------------------
var flashCSS:TextField.StyleSheet = new TextField.StyleSheet();
_global.flashCSS.setStyle("p",
{color:'#000000',
fontFamily:'Verdana, Geneva, Arial, Helvetica, sans-serif',
fontWeight:'normal',
fontSize:'10'}
);
_global.flashCSS.setStyle(".hdl",
{color:'#959595',
fontFamily:'Verdana, Geneva, Arial, Helvetica, sans-serif',
fontWeight:'normal',
fontSize:'10'}
);
...
----------------------------------------
i would like to apply this CSS to ANY textfield in ALL levels of the project ...
but if i apply the CSS in some loaded (external) .swf like this:
----------------------------------------
textWindow.styleSheet = flashCSS;
textWindow.htmlText = "<span class='hdl'>Example Example Example</span>";
----------------------------------------
it does not work at all and CSS is not applied
does anyone know how to use one CSS globally in all levels of the project (including loaded external .swf)?
Global Value...
Hello all..
I need a help for my current project.....
actually i have nearly 5 swf's in different levels.
i need to use all these swf's and some common variables or values...
as there is no option for variable passing b/w levels i'm not able to do that...
is there any alternatives to access the variable (i need to update or change the values of varables).
can anybody suggest a solution...
solutions will be highly appreciated...thanks in advance...
I Need A Global Var?
Hello again, i have this code.
PHP Code:
import flash.display.*;import flash.events.*;import flash.utils.*;import flash.display.Loader;import flash.display.MovieClip;import flash.display.LoaderInfo;import flash.net.URLRequest;import flash.text.TextField;import flash.events.Event;import flash.events.ProgressEvent;import caurina.transitions.Tweener;import flash.display.MovieClip;import flash.display.StageAlign;import flash.display.StageScaleMode;stage.align=StageAlign.TOP_LEFT;stage.scaleMode=StageScaleMode.NO_SCALE;stage.addEventListener(Event.RESIZE, resizeHandler);addEventListener(Event.ENTER_FRAME, resizeHandler);var aCarregar:Loader = new Loader();carregarSwf("count");function resizeHandler(event:Event):void { preloaderBarra.x = (stage.stageWidth/2); preloaderBase.x = (stage.stageWidth/2); preloaderLogo.x = (stage.stageWidth/2); menuTopo.x = (stage.stageWidth)/2; footerTexto.x = (stage.stageWidth)/2; footer.width=(stage.stageWidth); footer.align=StageAlign.LEFT; var externalMovie = MovieClip (aCarregar.content); trace("externalMovie "+externalMovie); if (externalMovie!=null){ trace("nao ha") } else{ externalMovie.centro.x=(stage.stageWidth/2); }}function carregarSwf(teste:String) { var swfACarregar:String=teste; var swfQueCarrega:URLRequest = new URLRequest(swfACarregar+".swf"); preloaderBarra.alpha=0; preloaderBase.alpha=0; preloaderLogo.alpha=0; menuTopo.y=menuTopo.y-70; aCarregar.load(swfQueCarrega); aCarregar.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader); aCarregar.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress); }function showPreloader(evt:Event):void { Tweener.addTween(preloaderLogo, {alpha:1, time:0.5, transition:"easeOutBounce"}); }function showProgress(evt:ProgressEvent):void { var numero:uint = (evt.bytesLoaded/evt.bytesTotal)*100; preloaderBarra.width = (numero*1.55);}function showLoadResult(evt:Event):void { preloaderLogo.visible=false; preloaderBase.visible=false; preloaderBarra.visible=false; var externalMovie = MovieClip (aCarregar.content); stage.addChildAt(externalMovie,0); }
How can i resize the extenalMovie, i cant call function resizeHandler with externalMovie inside, can someone help me?
Sorry de bad english
Global Variables Within MCs
ive used this code on a button:
selectedscene = "begincontactus";
and at the endd of the current scene ive said:
gotoAndPlay(selectedscene);
this works fine when the button is on the main timeline but when i put it wihtin an mc on the main timeline it doesnt work. do i have to use targets for gloabl variables? how?
Global Variables
ive used this code on a button:
selectedscene = "begincontactus";
and at the endd of the current scene ive said:
gotoAndPlay(selectedscene);
this works fine when the button is on the main timeline but when i put it wihtin an mc on the main timeline it doesnt work. do i have to use targets for gloabl variables? how?
Local To Global Example For D/l
I made a quick example for n8w over at Were-Here, who was asking about this. I know it's pretty straight forward, but if it helps anyone, you are welcome to d/l it. It's in the downloads section (duh) at:
http://www.developette.com
hope it helps someone...
Global Variables
ive used this code on a button:
selectedscene = "begincontactus";
and at the endd of the current scene ive said:
gotoAndPlay(selectedscene);
this works fine when the button is on the main timeline but when i put it wihtin an mc on the main timeline it doesnt work. do i have to use targets for gloabl variables? how?
Global Variables
ive used this code on a button:
_root.selectedscene = "begincontactus";
and at the end of the current scene ive said:
gotoAndPlay(_root.selectedscene);
this works fine when the button is on the main timeline but when i put it witin an mc on the main timeline it doesnt work. do i have to use targets for gloabl variables? how?
actually i have five MCs wtihin an MC on the main timline.
there is a button within each of the five MCs. an action on the buttons changes the variable. so ive created the variable first in the main timeline and refered to it from within the buttons' actionscripts. so i created
_root.selectedscene = "empty"
on the first frame of the movie just to create it.
why isnt it working??????????
Global Variable
how do i set a global variable??>??
i've been stuck with var statment...than after hours i found out that var is a local... variable
than i try set variable statment... and when i trace it... i can't get the variable...
acturally..
//i set a variable call interval
onClipEvent(load)[
interval = 20;
]
than inside that clip when i trace interval i get 20...
but inside the block
tellTarget ("_root.menu.web") {
trace (interval);
}
i get nothing...
[Edited by remote on 07-17-2001 at 09:00 PM]
Local And Global
hi...
can someone explain me the diff. between a normal variable & a variable created by var
i mean:
a = "name"
var a = "name"
i understand that its a local variable but wats the scope... the guide says its lasts in curly brackets only...
but can we use them across the frames...? on one timeline... or what...?
slightly confusing... i only use var for variables in loop like For (var i=0; i<=10; i++)
thanks
arpit
Global Variables
hi there,
how can i properly define global variables, meaning variables which can be seen from any scene in my movie?
if i start defining it (like normal) with "var myVar = 42" i can access it only from within this scene. if i just use it without defining it, i can access it from any other scene too, but it doesn't look very clean to me, so is there a better solution for this problem?
bye, stevie.
Global Varibles
how can i declare global varibles, used in the same movie but by different sequences? thanks, claudia
Global Var Declaration
I am trying to have variables accessable globally
I have declared then on frame 1 like this
hello = 450;
by using trace I can see that hello retains its value in frame two. so far so good
I wish to access my variable hello from within a button.
THe variable does not seem to parse here.
I place trace after an onrelase event and the variable comes up as empty and not 450.
I need to use this variable within my button script
What can I do? thanks in advance
Which Vars Are Global?
I have a movie in _root which has the ability to load a form that is contained in its own movie into _level1.
When this form sends the data to the server, it's sending a **LOT of information along with it. Some of this is good, some is a waste of bandwidth.
How do I know which variables will be submitted? I understand that global variables will go, does this mean all variables defined in _root, or will variables defined in _level1 go too?
Is there a common practice on where to store your variables so that they are not arbitrarily sent to the server? If so, how can I selectively send my vars to the server?
I thought that maybe I could load a different movie into _level1, and put variables there. Then load my form into _level2. Will this help?
Thanks,
Matt
Global Variables?
Simple, easy question that I can't seem to find the answer to: How do you declare and change a global variable? Thanks
-Llama
Global Varibles
Does anyone know if there is any way to set a global variable from within a function?
Here's a link to the page that I'm having a problem with: http://www.kawaguchi.ca/georev/main.html
Basically, what I need is a way to retain which primary section is rolled over. If anyone has any idea, I'd love to hear them.
Thanks in advance.
Variable In MC As A Global
Hi again,
here is another problem:
in my MC's (embeded a button) I am working with various variables which need to interact with one another, say if one variable is 2 another MC cannot be used anymore..:
on (release) {
door = door+1;
if (door == 1) {
setProperty ("/door-movie", _x, 327);
counter == counter+1;
trace(counter);
}
if (door == 2) {
door = 0;
counter = counter-1;
setProperty ("/door-movie", _x, -100);
}
if (counter>2) {
setProperty ("/door-movie", _x, -100);
door = 0;
counter = 2;
}
}
but my counter-variable is not traced.... what can I do???
(did you understand what I mean????)
Global Variables
I'm trying to do an Audio ONOFF button for my scene. This is what I did:
-Created a movie instance containing the wav file.
-Assigned the above instance to an object with "new Sound" command in first timeline frame:
suono = new Sound(audio); *audio IS THE WAV INSTANCE*
aa=true; *this global variable is intended to be used for the switch behaviour*
-Created a second key frame on time line and placed "Stop()" command.
-Created a switch button.
-Assignet the following script to the button instance:
on (release) {
aa=!aa;
if (aa==false) {
suono.stop();
}
else {suono.start()};
}
When first I press the button, the music stops, but after that I cant let it start again. The global variable "aa" works at the beginning, but seems that it cant keep the "false" value after the mouse leaves the button. This is what I think. Maybe the debugger would give great help in this matter, but I cant see the "aa" variable on it.
Any idea?
Global Variables
Hi,
I have two issues.I would greatly appreciate if someone can help. First thing, How do I create global variables like. I have created some variables by loading a xml file while loading the movie. I want to reuse them in the movie clip mousedown events. Now I am again loading it unnecessarily.
Secondly how do I reuse the functions I created in one movie in another. Now I am needlessly typing the same function in all the MCs.
Please help
Thanks
-r-
Global Data Or Not?
If I have a loadvariable on the 1st frame on the 1st scene, will all the variable imported still be kept in all subsequent scenes?
Thanks
Set Global Variable
hello...
i need to set a global variable from within a movie clip.
what i want to happen is when this particular movie clip plays, it sets this variable. i want the variable to be available the entire time (and throughout the movie), the clip is active on the stage. i then want to be able to reference this variable from anywhere else in the movie. can someone show me the way?
thanks...
|