|
-
Increasing a variable on release
Hello,
in my first frame i have
var picnumbers = 1;
i have a button that i want to use to increase this variable by multiplying it by 4.
ive looked on the web and cant find it!
thanks a lot for your help
junior
-
on(release)
{
picnumbers = picnumbers * 4;
}
-
brilliant, i thought it was that.. i just put it under a line instead of on top of one.
another question if i may,
i am running an external class too,
my first frame.
var picnumbers = 1;
butGo.onRelease = function()
{
simpleSearch.doSearch(tag.text);
}
this is my button atm and it increases pic numbers
on (release) {
simpleSearch.doSearch(tag.text);
picnumbers = picnumbers * 4;
myTextbox.text = picnumbers;
}
this is the first line of my external class that i am using..
public static var NUM_RESULTS:Number = 1;
how do i get that number 1 to become picnumbers?
-
A shorter way of doing it is:
picnumbers *= 4;
[Edit] What is the name of the class file? To get something from a class file you do this:
code: var blah:ClassFileName = new ClassFileName();
something = blah.variable;
Something like that.
Last edited by swak; 04-17-2007 at 10:30 PM.
.
-
i want the classfile to be able to read from my main flash movie..
not the other wayaround..
i am declaring picnumbers in the main movie, and want to, somehow, make the external class get the variable..
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|