Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : Using a global variable in on (rollOver)


Zillion1000
3/5/2004 8:35:45 PM
Hello

I want to use a variable in a button.
In Frame 1, I declare for example Zoomfactor=100 (I tried both
_global.zoomfactor=100; and zoomfactor=100;)
In Frame 2 is a button with which I want to zoom in on a object:

on (rollOver) {
zoomfactor=zoomfactor+5;
setProperty("_level0/Map", _xscale, zoomfactor);
setProperty("_level0/Map", _yscale, zoomfactor);
gotoAndPlay(2);}

However variable zoomfactor is 'undefined' here, if check it with
trace(zoomfactor) or trace(_global.zoomfactor) and the 1st value will be set to
5. So appearently I cant pass the variable to a rollover? How can I do this?

Thank you

Zillion1000
3/5/2004 9:00:26 PM
Nope that doesnt work , but thx
PierreAlain
3/5/2004 9:49:21 PM
try _parent.Zoomfactor

as Zoomfactor is defined in the parent of this button

--

Pierre Alain

pie@lifnet.com


"Zillion1000" <webforumsuser@macromedia.com> a écrit dans le message de
news:c2aob1$5nl$1@forums.macromedia.com...
[quoted text, click to view]

PierreAlain
3/5/2004 10:27:02 PM
another point. If you use MX2004, beware the caps

Zoomfactor is different from zoomfactor

--

Pierre Alain

pie@lifnet.com


"Zillion1000" <webforumsuser@macromedia.com> a écrit dans le message de
news:c2appa$7ip$1@forums.macromedia.com...
[quoted text, click to view]

Zillion1000
3/6/2004 10:32:44 AM
AddThis Social Bookmark Button