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








Global Variable


I am calling cfmfiles through

onClipEvent (load) {
CurrentRecord = 0;
loadVariables ("http://www.xxxxxx.xxx/stardot.cfm", 0);

I want to call this files only once. Here I am using thrice How can I set global variable?



...shankar...




FlashKit > Flash Help > Flash ActionScript
Posted on: 08-26-2002, 06:26 AM


View Complete Forum Thread with Replies

Sponsored Links:

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..

View Replies !    View Related
New Variable = Global Variable Not Working
Could someone please explain why, when I add var newArray = _global.nameA[0], and try to trace newArray, it returns undefined, but returns the correct variable with _global.nameA[0]?

ActionScript Code:
xmlData.onLoad = function(success) {
        if (success) {
            _root.showXML = this;
            var comp = xmlData.firstChild.firstChild.childNodes;
            _global.nameA = [];
            for (i=0; i<comp.length; i++) {
                _global.nameA[i] = this.firstChild.firstChild.firstChild.nodeValue;
        }
//var newArray = _global.nameA[0];
playButt.onRelease = function() {
    trace(_global.nameA[0]);
       //trace(newArray);

};
Many thanks in advance

View Replies !    View Related
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]

View Replies !    View Related
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????)

View Replies !    View Related
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...

View Replies !    View Related
Global Variable?
hi, here my problem:

i want to show a text-file in my swf, so i set the variable which contains the text.

in the main-scene it works, but in movie-clips, the variable is no longer set.

how can i set a variable global, or how can i put the variable from the main-scene in a movieclip?

sorry for my english

View Replies !    View Related
Global Variable HELP
I am trying to use the "if , else" function to get a page to play an audio only once -- just the first time a user opens the page, which is inside loaded inside another movie (a navigation system).

I've looked at trying to set a global variable after the audio is played for the first time which would communicate that it has been played to the script the next time this page opens.

I just can't figure it out.

I hope I have explained clearly enough.

Thanks!!!
-Rob

View Replies !    View Related
Global Variable
I have a txt file called "puppycount" with the text "count=3" in it(without the "").

What is the actionscript to load this value into flash and make it a global variable. Also, what is the actionscript to use this globalvariable in a movieClip.

thanks

View Replies !    View Related
Global Set Variable Value Possible?
just a quick one:

is there a way to set a bunch of variables to one value: i.e. instead of having

Code:
var0 = "true";
var1 = "true";
var2 = "true";
var3 = "true";
var4 = "true";
var5 = "true";
just have one line stating that the variables "var0-5" are all true?

just a thought...

cheers

View Replies !    View Related
Global Variable Help Please
ok I have a main movie clip (We'll call it index.swf) in that I have a slideshow and for each picture that loads I have an external swf (pics01.swf, pics02.swf, etc up to 14).
Now I also have a navigation that is nested inside index.swf. The movie clip is called "Kitnav" and inside that is a movie containing all the movie thumbnails that can be clicked on, that one is called "Boxes".
What I want to do is to be able to click on one of the thumbnails and have it send a global variable. Then, whatever movie is playing (pics01.swf, etc.) will jump to the part where it closes....finish the animation and then jump to the new pics#.swf.
I've done this before witin one movie without using global variables. How would I do this? please help.

-= greendog =-
PS here is a link to the site

View Replies !    View Related
Global Variable
I have a menubar with buttons, and 2 MC's, one to expand a button's menu, and one to collapse. I am trying to set up a global variable so that the menu button will be aware of when it is in an expanded state and when it is not..

My question is, I tried to set a global variable in the first frame of my movie: set (home,0);

The expand MC sits in frame 2 and the collapse MC in frame 3.
On one of the menu buttons, I have the following condition set (just as a test run)

on (release) {
if (home==0){
gotoAndPlay (2);
home=1;
}
else {
gotoAndPlay (3);
home=0;
}

Can you tell what I am doing wrong, or am I going about this the wrong way. Basically both expand/collapse do not work at all.

Thanks in advance,
HankHill

View Replies !    View Related
Global Variable?
Hello i am trying to make a multilanguage movie that has 3 text files en.txt,ru.txt,cz.txt they al have the same variables but in different language , Now i have he main movie test.swf that loads the default variable to the movie
PHP Code:




loadVariables("en.txt",0);





then i have 3 buttons that swithc between langueages by loading different files (eg.
PHP Code:




on (release) {loadVariables("cz.txt",0);}





) but i have some swf files that are loaded into my test.swf how to affect them with the laodVariable text file change for example if i change the file form en.txt to cz.txt so it would change the it in test.swf and all loaded movies in it.



any advices are welcome!
Thanks in advance


PS: i have a small example of what i mean here.
test.swf file

View Replies !    View Related
Global Variable
How do i make a variable be able to be read by any movieclip or timeline? The variable is being loaded from a txt file. Is this creating a problem?

View Replies !    View Related
Global Variable Help
I have a button that i would like to enable and disable a function within my game.

the button is called flashBang:

I'm thinking this may need to be done with global variables to make the switch do this procedure.

How would i go about scripting this variable???

Also i want to be able to target this function during gameplay, if this function is enabled do this line of code - (_root.gotoAndPlay("flash");.

The code needs to fit somewhere in here i guess.

//hitTest top + bottom wall
if (_root.ball.hitTest(_root.topwall) or _root.ball.hitTest(
_root.bottomwall)) {
_root.yspeed = -_root.yspeed;
_root.audio.gotoAndPlay("flash_bang");

ANY HELP WOULD BE GREAT,
Cheers
Peter.D

View Replies !    View Related
Global Variable?
ugh. sorry if this has been answered before / is in the wrong place.
how can i refer to a variable from one movie clip in another? hmm, better wording...
in the game i have options for aim high / medium / low. So in the man movie clip, when he is standing manPosition =1, sitting manPosition = 2, laying down =3. I need to use this variable in an if statement for a different movie clip, and i cant get it to work.

View Replies !    View Related
Set Global Variable Except 1?
I have about 90 instances of the same movieclip that, depending on if a variable is A or B... will go to a different frame.

I have set the variable to globally be A on the first frame... but when one of the movieclips is clicked, it goes to the different frame, I set that specific movieclip to be B.

Ok.

So now I have the problem... when one of the other movieclips changes from A to B, I need it to have all the other movieclips that are B to move back to A.

So... I have made the movieclip keep checking itself so see if it's A or B:


Code:
// if its on frame1, set all the other mcs to 0
if (this.mcvariable == B) {
_global.mcvariable = A;
this.mcvariable = B;
play(); // keep checking the next frame goes to frameB again
}

// else go to A frame and stop
else (this.mcvariable == A) {
this.gotoAndStop("frameA");
}
But... I can't make _global.mcvariable =A and then change it again for the specific instance.

I need some help on this urgently, How do I do this?

Thanks.

View Replies !    View Related
Global Variable Help With XML
How can I get the attribute.id into a global variable?

ActionScript Code:
//load xml file
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
    if (success) {
        trace("loaded");
        trace( my_xml.firstChild.firstChild.attributes.id);
    } else {
        trace("not loaded");
    }
};
my_xml.load("images.xml");

View Replies !    View Related
Help About Global Variable
hi,
I'm just a flash beginner and having some trouble when developing a flash application.
Basiclly for this part of the application, everytime you you press the Space key, one more human figure will be added to the screen. To control this human figure by keyboard, click the mouse over it to activate the keyboard control. If a human figure is activate then the rest will remain at its current position until it is click again.
i created a button within the human movieclip so that i can activate it when clicking by mouse.
The code below works fine for the above description, but then i need to retrieve all the intances names of the human moveclips created on screen to refer to them in a hittest function where i need to detect if these human movieclip is collided with another movieclip. I'm not sure how to work that out...Does the description make sense? I'm sorry for my bad english. please check the code for me. Is there any other way to do this?

Please please help me out
Thank you ^____________^

In the main Timeline i have this code

// duplicate the human figure
keyListenner = new Object();
keyListenner2 = new Object();
a = 0;
keyListenner.onKeyDown = function() {
if (Key.getCode() == key.SPACE) {
a++;
_root.human_mc.duplicateMovieClip("human_mc"+a, a, {_x:780, _y:320});
}
};
Key.addListener(keyListenner);
//move figure
keyListenner2.onKeyDown = function() {
l = 25;
if (Key.getCode() == key.UP) {
var oldCo:Number = getProperty(b, _y);
newCo = oldCo-l;
setProperty(b, _y, newCo);

} else if (Key.getCode() == key.RIGHT) {
var oldCo:Number = getProperty(b, _x);
newCo = oldCo+l;
setProperty(b, _x, newCo);

} else if (Key.getCode() == key.LEFT) {
var oldCo:Number = getProperty(b, _x);
newCo = oldCo-l;
setProperty(b, _x, newCo);

} else if (Key.getCode() == key.DOWN) {
var oldCo:Number = getProperty(b, _y);
newCo = oldCo+l;
setProperty(b, _y, newCo);

}
};
Key.addListener(keyListenner2);
And in the human figure i have this code
on (release) {
_global.b = this._name;
}
I'm just wondering if i can access this variable from the main Timeline...i tried to use
trace (_global.b);
and
trace(getProperty(b,_name)) on the mai Timeline...but the result is undefined..

View Replies !    View Related
Global Variable?
Hi,

Does anyone know how to declare global variables, I tried like this.


package nks {

public static var nice:String = "asd";
}

and then in another package

package something {

import nks;

public class
.....
trace(nice);

}

Is there something I'm doing wrong?

Thanks in advance...

View Replies !    View Related
Global Variable.
hi everyone

I am a new to actionscript and I have the follwowing problem.

I have on the first frame an input box and a dynamic box.

The variable name of the dynamic box being "mytext_tel"
the variable name of the input box being "mytext_eng"
and also a stop();

whatever is typed in the input box i catch that (keylistener)
and place that in the dynamic box.

now when a button is clicked, the movie goes to frame 10 and has a back button also in it.

The movie works fine on the first frame. When it comes back to frame 1 it still remembers what was there in the variable "mytext_tel" and "mytext_eng"

i need to empty then before it comes to frame 1.

I NEED TO MAKE my variables such that THEY CAN BE SEEN IN ANY FRAME ANY LAYER. so that i can give on frame 10.

mytext_tel="";
and mytex_eng="";


I hope you for my question.
Thanks in advance.
pessi..

View Replies !    View Related
Global Variable Help Seriously....
Hi all, I got a global variable that I want to see the output for using trace.
The problem is it comes out blank when I do trace. It gets it data from an xml file. I don't see how it could not get data. If I put the trace inside the function it outputs a value but not outside the function. Must I make the function global or something? Please help! Thanx guys


Code:

_global.xValue;
_global.userInfo = new XML();
_global.userInfo.ignoreWhite = true;
_global.userInfo.load("http://localhost/gBook/userInfo.xml");
_global.userInfo.onLoad = function(success) {
if(success)
{
var root = this.firstChild

nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
subnodes = nodes[0].childNodes
subnodes2 = nodes[1].childNodes
subnodes3 = nodes[2].childNodes
_global.xValue = subnodes[0].firstChild.toString()
_global.xValueOne = subnodes2[0].firstChild.toString()
_global.xValueOne2 = subnodes3[0].firstChild.toString()

}
}

}

trace("Glob x:" + _global.xValue );

View Replies !    View Related
Global Variable Help
Im trying to load variables from an XML file and then use those variables to attach a video to a netStream. The problem is netStream doesnt work inside a function (at least I cant get it to) and I cant access the variables outside of the function.
What I need is a way to either define or alter a variable inside an onLoad function and then be able to call that variable outside of the function.
Something like this:
quote:var myVariable="hello";
onLoad=function(){
myVariable="goodbye"
}
trace(myVariable);
^When I trace I want the output to be goodbye rather than hello

I have tried using _root.myVariable and _global.myVariable but when I trace either I get undefined or I get the original value of the variable and not the new value.
Any ideas?
Thanks

View Replies !    View Related
Global Variable In As3.0
I am doing something with flash cs3,I need to use global variable in it ,but there is not global variable in as3.0,can anyone help me ,thanks forever!

View Replies !    View Related
Global Variable Help Seriously
Hi all, I got a global variable that I want to see the output for using trace.
The problem is it comes out blank when I do trace. It gets it data from an xml file. I don't see how it could not get data. If I put the trace inside the function it outputs a value but not outside the function. Must I make the function global or something? Please help!


Code:
_global.xValue;
_global.userInfo = new XML();
_global.userInfo.ignoreWhite = true;
_global.userInfo.load("http://localhost/gBook/userInfo.xml");
_global.userInfo.onLoad = function(success) {
if(success)
{
var root = this.firstChild
var b=0;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
subnodes = nodes[0].childNodes
subnodes2 = nodes[1].childNodes
subnodes3 = nodes[2].childNodes
_global.xValue = subnodes[0].firstChild.toString()
_global.xValueOne = subnodes2[0].firstChild.toString()
_global.xValueOne2 = subnodes3[0].firstChild.toString()
}
}

}
trace("Global x: " + _global.xValue);

View Replies !    View Related
Global Variable Help
I have a button that i would like to enable and disable a function within my game.

the button is called "flashBang"

I'm thinking this may need to be done with global variables to make the switch do this procedure.

How would i go about scripting this variable???

Also i want to be able to target this function during gameplay, if this function is enabled do this line of code - _root.gotoAndPlay("flash");

The code needs to fit somewhere in here i guess.

//hitTest top + bottom wall
if (_root.ball.hitTest(_root.topwall) or _root.ball.hitTest(
_root.bottomwall)) {
_root.yspeed = -_root.yspeed;
_root.audio.gotoAndPlay("flash_bang");

ANY HELP WOULD BE GREAT,
Cheers
Peter.D

View Replies !    View Related
Global Variable?
I'm trying to define my code somewhat but I'm not very successful. I was hoping that someone could give me a hand?

Have a few input boxes where users have to add text to answer question. In my code so far, they have to click a button for each question to see if they are correct

Code:
n (release) {
_root.comment1 = "";
if (_root.input1 == "her") {
_root.comment1 = "Correct";
} else {
_root.comment1 = "Wrong";
}
and then the same code over and over again...does anyone know a way I can create a handy little function to solve this problem?

Any help would be appreciated!

Y

View Replies !    View Related
Global Variable Help
I've been trying for a while to set a global variable from an xml file within a function and then be able to use it in another function. Any help would be appreciated.


Code:
function loadXML(loaded) {
if (loaded) {
_global.columns = this.firstChild.firstChild.firstChild;
xmlNode = this.firstChild.nextSibling;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

previous_btn.onRelease = function() {
prevImage();
};

next_btn.onRelease = function() {
nextImage();
};

p = 0;

this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};

function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}

function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}

function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}

function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}

thumb_spacing = 110;

function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = (k%columns)*thumb_spacing;
target_mc._y = Math.floor(k/columns)*80;
//target_mc._x = (target_mc._width+thumb_spacing)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
-Thanks-
Saveth

View Replies !    View Related
Global Variable
can global variable share its value in other scene as well?

View Replies !    View Related
Global Variable
Hai Friends,


I Have Some Doubts.

(1). Is Any Global Variable Declaration Available In Flash.ie,A Variable Declared In One Frame That Is Available In Other Scene,Movieclip,Frames,Layers ...If Not How To Make These Things.

(2).If Any Wait Function Available In Flash.like wait() Function In C.ie,Waiting Between Two statements



Thank U
God Bless You

View Replies !    View Related
Global Variable Help?
hey all,

i'm wanting to use global variables so that i can check if my radio buttons are selected and show that when i hit my back button...but i'm kind of new to global variables...any body know how to do this or any good tutorials on global variables??

Cheers peeps

View Replies !    View Related
Global Variable?
Hey kirupians, really struggling with this - have got so far - think have cracked it and SLAM brick wall... *groan*..

I have an array holding 'image' and 'name'

name loops fine and populates a load of movie clips underneath each other...
i need for when this name is clicked to load an image in another movie clip (image name comes from the array)..

the code i have works but it only pulls throught the last item of the array which points to a problem with 'i' not being carried across the functions..?

that is the result of my investigation *smokes pipe* - any help would be appreciated!.


PHP Code:



function loadceleb() { for (i=0; i<total; i++) {  this.contentMain.attachMovie("chold", "hold"+i, i, {_x:xPos, _y:yPos});  yPos += this.contentMain["hold"+i]._height+5;  this.contentMain["hold"+i].text_hold = clname[i]; // at this point textboxes are populated and set up on the stage  imagename = image[i]; // tried tying imagename to the image array so i can then use in the function below  this.contentMain["hold"+i].onPress = function() {   _root.image_cont.gotoAndPlay(109);   this.celeb.img.loadMovie(imagename); // this works fine but only pulls through the last image in the array - argh!   trace(imagename);   _root.image_cont.celeb.lineani.gotoAndPlay(1);  }; }}stop(); 

View Replies !    View Related
Global Variable Help Seriously
Hi all, I got a global variable that I want to see the output for using trace.
The problem is it comes out blank when I do trace. It gets it data from an xml file. I don't see how it could not get data. If I put the trace inside the function it outputs a value but not outside the function. Must I make the function global or something? Please help!


Code:
_global.xValue;
_global.userInfo = new XML();
_global.userInfo.ignoreWhite = true;
_global.userInfo.load("http://localhost/gBook/userInfo.xml");
_global.userInfo.onLoad = function(success) {
if(success)
{
var root = this.firstChild
var b=0;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
subnodes = nodes[0].childNodes
subnodes2 = nodes[1].childNodes
subnodes3 = nodes[2].childNodes
_global.xValue = subnodes[0].firstChild.toString()
_global.xValueOne = subnodes2[0].firstChild.toString()
_global.xValueOne2 = subnodes3[0].firstChild.toString()
}
}

}
trace("Global x: " + _global.xValue);

View Replies !    View Related
Global Variable Help
I have a button that i would like to enable and disable a function within my game.

the button is called "flashBang"

I'm thinking this may need to be done with global variables to make the switch do this procedure.

How would i go about scripting this variable???

Also i want to be able to target this function during gameplay, if this function is enabled do this line of code - _root.gotoAndPlay("flash");

The code needs to fit somewhere in here i guess.

//hitTest top + bottom wall
if (_root.ball.hitTest(_root.topwall) or _root.ball.hitTest(
_root.bottomwall)) {
_root.yspeed = -_root.yspeed;
_root.audio.gotoAndPlay("flash_bang");

ANY HELP WOULD BE GREAT,
Cheers
Peter.D

View Replies !    View Related
Global Variable?
I'm trying to define my code somewhat but I'm not very successful. I was hoping that someone could give me a hand?

Have a few input boxes where users have to add text to answer question. In my code so far, they have to click a button for each question to see if they are correct

Code:
n (release) {
_root.comment1 = "";
if (_root.input1 == "her") {
_root.comment1 = "Correct";
} else {
_root.comment1 = "Wrong";
}
and then the same code over and over again...does anyone know a way I can create a handy little function to solve this problem?

Any help would be appreciated!

Y

View Replies !    View Related
Global Variable
Hi,

I'm trying to set a global variable so that when I mouseover on a certain movie clip (B) another movie clip (A) will go back to frame 1 if variable is 0.
This is what I wrote on the first frame of the root (where A and B are):

Code:
_global.quienes = 0;
Whithin C, there is a script than theoretically sets the variable to 1 on press. This is:

Code:
on (press) {
_global.quienes = 1;
}
Then, in actions for B I wrote:

Code:
on (rollOver) {
if (_global.quienes = 0) {
_root.A.gotoAndStop(1);
_root.C.gotoAndStop(1);
}
}
But nothing happens. This is the first time I use variables so I am probably doing something (or everything) wrong. Any hints?

Thanks
Laura

View Replies !    View Related
Global Variable
how do you make a variable were you can call it from anywhere by its name.

Thanks

View Replies !    View Related
Global Variable
I made the stupid mistake of designing frame wise--I have six frames with different games in each one--instead of nesting between movie clips. I don't want to start over however. My problem is, I have a global variable that needs altering if you win a game and then go back to the original frame 1...problem is, when I go back to frame 1, my global variable resets to 0 and loses the value from frame 2 or 3...so on. How can I keep this global variable in check??

View Replies !    View Related
Global Variable
Hey guys,
I have a tricky question, well may not be for you.
I have a navigation built so that when one button is clicked it jumps to another frame in the timeline. Now I have a rollover on those buttons which flash or do whatever, now when I click on another button, the timline jumps to that frame, but still leaves the previous button still flashing. I'm wondering if a global variable called upon which says turn off the previous button would work. I don't know how to go about it. OR I coud just be looking at this wrong.
Thanks for any help.

View Replies !    View Related
[help]global Variable
i made fla file for analog clock.it is in using timer object in frame1 action.

var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER,rot);
timer.start();
_global.count=0;////// syntax error
function rot(evt:TimerEvent){
handle.rotation +=5;
count++;

}
i want to crate that count variable global.
Please helppppppppp........

View Replies !    View Related
How To Use Global Variable With AS3
How to use global varialble in actionscript 3.0
please help.

View Replies !    View Related
Global Variable
i have declared 1 global variable

i trace from 2 different locations...both same answer

now i increment the global......now i trace, both different..



any help would be appreciated

View Replies !    View Related
Global Variable Hell
Wassabi....
Heres one. I understand the functionality fully, I think I need help with syntax.

Movie1(_level0) loads Movie2 (_level1). In Movie2 there is a button.
I want that button to hide Movie2 and set a variable (flag) on the main timeline to "1".

on (release) {
setproperty(Movie2,_visible, false);
_root.flag=1;
}
That part is OK I think. My problem is below....


When the movie loads, the (flag)variable is initially set to "0". When it is set to "1" from a click on the button in Movie2 I want this variable on the main timeline (Movie1) to load another movie (Movie3) into (_level3)

So on the main timeline I have the following:
flag="0";
if (flag=1){
loadMovieNum(Movie3, 3);
}

Of course..it doesn't work. I have even tried to set this variable to "1" manualy in Movie1 and that wouldn't even work so I know the button wont. Help please!

View Replies !    View Related
Local And Global Variable
HEllo,
Could anyone tell me how to define local variable and global variable in flash and their scope where we defince those variable i mean timeline;
Is there a way to force to define variable?


Best Regards

View Replies !    View Related
How Do U Declare A Global Variable?
Hi all,
Please help me with this one.
1.How and where do you declare a global variable in action script?
The declaration is going to be followed by the action:
On(release){

}

2.Also, If there are two scripts attached to two different
buttons (in the sane movie),
can variables and functions defined in one be accessed from the other?
I wud be grateful if u can include a sample script illustrating the above.
thanks.
triveni
my e-mail add:trivs17@hotmail.com

View Replies !    View Related
Global Variable In Flash 5
Hi ppl, I want to ask whether flash 5 uses global variable, and how to use it because I want to call a variable allGone in a function but allGone is located within a different function so that's why I want to use global variable but I don't think that this is a good idea. Both the function is within the same time frame. Thz

View Replies !    View Related
Global Variable In Movieclip
Hi.
I've been working on this for ages, and have run into a problem I just can't figure out. It seems like a bug in Flash to me, what do you think?
I've stripped the project down to the basics to describe this problem. Here goes......

I have a simple movie with a single layer in the main timeline and a single frame on that layer.
I have 1 button and 2 instances of the same movie clip on the frame.
One instance of the movie clip is called 'Target_11', the other is called 'Target_12'.

Here is the actionscript I have on the frame in the main timeline:
Stop
Set Variable: "Block" = 0

Here is the actionscript I have on the button in the main timeline:
On (Press)
Loop While (Block < 2)
Set Variable: "Block" = Block + 1
Trace (Block)
Begin Tell Target ("/Target_1"&/:Block)
Go to and Stop (2)
End Tell Target
End Loop
End On


Each movie clip instance has a single layer with 2 frames.

Here is the actionscript on frame 1:
Stop

Here is the actionscript on frame 2:
Trace (/:Block)

When I run the movie I would expect the output window to show this:
1
1
2
2

But what I actually get is this:
1
2
2
2

Can anybody tell me how I can get the Trace statement in the movie clip instance to show variable 'Block' as '1' then '2' as it should do.

Thanks in advance for any help you can give. I've been working on this for ages and can't figure out what is happening.

If you would like me to email you this test movie, let me know.

Regards.
Damian.

View Replies !    View Related
How Do I Make A Variable Global?
I have a variable that works just fine when I reference it from the MC it is in. But when I reference it from a diferent MC it doesn't load.

So I think it has something to do with variable scope.

What are the steps to making a variable global?

thanks

View Replies !    View Related
Global Variable Scope
I am designing a site consisting of several swf-files, and I am dependant on reaching global variables from the swf files which I load into the "Master" swf file.

There are not many variables so i suppose I could send them using a GET argument while I load the swf-file, but isn't that unnecessary?

-Shouldn't global variables be visible to all content loaded into a swf-master-file?

Help appreciated.

MAB71

View Replies !    View Related
Undifined Global Variable
I am trying to use global variables to go to different frames of a movie when loading using loadMovieNum(). I built a small test movie which works fine but when I put the code into a movie I have been working on then and run a trace all I get is undifined. I have stripped everything out of the old movie and copied and pasted the code from the new movie and it still does not pick up the global. Any ideas.

Thanx

View Replies !    View Related
Using A Global Variable In An Imported MC
I want to load an external .swf into my main .swf, it will contain a textfield. However, in order for it to know what to put in that text field, it must pick up on a variable.

main.swf

_global.USERENTRY

now in order for my mc user_output to display _global.USERENTRY, what must I do?

being _global just doesn't seem to be enough

View Replies !    View Related
Passing Global Variable
Hi all,
If i have the following:
code:
on(release){
trace(ace);
_parent._parent.prevFrame();
}

where ace is a global what is the best way to send that variable back to the previous page?

Cheers,
Chad

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved