all groups > flash actionscript > april 2004 >
You're in the

flash actionscript

group:

How to set a variable in 2004????


How to set a variable in 2004???? Gerrard
4/19/2004 10:19:05 PM
flash actionscript:
-After hours of trial and error with MX (AS1.0) I now belived there was a light
in the tunnel...but the evoultion forced me to upgrade and try out the MX 2004
pro!!
Then my world of understanding AS collapsed with the new AS2.0!!!
Every new release of Flash takes me 3 steps back and only two forward!!!

I just want to set a variable in MX 2004 Pro like I did in MX, but how?

In MX I used the script below to keep track of the playhead and write the
framenumber in the textfield named "frameX".

this.onEnterFrame = function() {
frameX = _currentframe;
};

When pressing esc+sv something new happens and the similar script doesn't work
anymore:

this.onEnterFrame = function() {
set (frameX, _currentframe);
};

Why won't this simple script work in the the release???

Thanks
Re: How to set a variable in MX2004???? kglad
4/20/2004 12:50:02 AM
your first block of code should work, though i'm not sure what you mean by a
textfield named frameX. if your textField has in instance name of frameX you
should be using:

this.onEnterFrame = function() {
frameX.text = _currentframe;
};
Re: How to set a variable in MX2004???? Gerrard
4/20/2004 12:19:55 PM
Thanks kglad!

You're right!
"frameX" is the textField variable name and the old code works in MX2004, BUT
I'm used to the esc-shortcut keys but the new version of AS confuses me. Set
variable dosen't act the same way in AS vs AS2.0. Can I get the old MX actions
panel back in the new release?


Re: How to set a variable in MX2004???? kglad
4/20/2004 1:59:56 PM
no, you can't get the old "basic" actions panel. there are some panels that
you can use that give extra help that's almost as good as the old actions
panel, but i don't know what they are. i've seen a message here that mentioned
the panels that give extra help for coding.

i don't know why set() doesn't work in a.s. 2. the set-method was being
phased out in flash 5 when i started using flash, so i've never used it. there
are prefered methods, but i've not seen anything saying that the set-method is
no longer supported. but it clearly isn't supported, so you need to use an
alternative method.
Re: How to set a variable in MX2004???? Gerrard
4/20/2004 8:19:40 PM
Just when I felt I could see the top of the moutain MM creates a new one twice
as big for me to climb! That's what I feel like right now with AS 2.0 and
MX2004.
Seems like all my AS knowledge need some adjustment....and that's to bad
because I was hoping to start producing something for once not just fumbling
around trying to learn.

Thanks anyway kglad!

PS I guess MM is already creating trouble for me at the next mountain top!
Re: How to set a variable in MX2004???? kglad
4/21/2004 2:08:39 AM
AddThis Social Bookmark Button