Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-29-2004, 05:47 PM   #1
androowzzz
Registered User
 
Join Date: Jun 2004
Posts: 28
Default OnClipEvent (mousemove) not updating

Ok I declare a variable in the first frame

PHP Code:
_global.x_pos _root._xmouse
theres a movie named "box" on _level0, and another movie that covers the stage with the code:

PHP Code:
onClipEvent (mouseMove) {
    if (
_global.x_pos>0){
    
_level0.box._height _global.x_pos/2;
    }

The hieght changes once...but doesn't update constantly

I proabably look like an idiot to you guys, but what am I doing wrong here? (Flie attached)
Attached Files
File Type: zip Untitled-2.zip (4.8 KB, 173 views)
androowzzz is offline   Reply With Quote
Old 07-29-2004, 07:06 PM   #2
webreake
Senior Member
 
Join Date: Oct 2003
Location: mexico
Posts: 214
Send a message via MSN to webreake Send a message via Skype™ to webreake
Default

mm updateAfterEvent()
webreake is offline   Reply With Quote
Old 07-30-2004, 01:37 PM   #3
androowzzz
Registered User
 
Join Date: Jun 2004
Posts: 28
Default

I put updateAfterEvent() in the onClipEvent but it still doesn't work...
androowzzz is offline   Reply With Quote
Old 07-30-2004, 01:41 PM   #4
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

chances are _global.x_pos is never > 0 so it never updates

just a thought
__________________
(6)
senocular is offline   Reply With Quote
Old 07-30-2004, 02:44 PM   #5
androowzzz
Registered User
 
Join Date: Jun 2004
Posts: 28
Default

Nope, I changed the code to this and it still just scales it once and doesn't respond anymore.

PHP Code:
onClipEvent (mouseMove) {
    
_level0.box._height _global.x_pos/2;
    
updateAfterEvent();

androowzzz is offline   Reply With Quote
Old 07-30-2004, 03:01 PM   #6
devonair
ET3
 
Join Date: May 2004
Location: Sicily
Posts: 332
Default

hey, androowzzz,

when you declare your global x_pos variable, it takes the current _xmouse position and stuffs it into your variable and that's it - the variable never updates.

really, there is no need for x_pos at all, just use the current xmouse position and skip the middle man. Try just this in the first frame of your movie (get rid of everything else):

PHP Code:
onMouseMove = function () {
    if (
_xmouse>0) {
        
box._height _xmouse/2;
    }
}; 
I think that's the effect you're looking for. hope it helps.

d.
devonair is offline   Reply With Quote
Old 07-30-2004, 03:04 PM   #7
ericlin
Registered User
 
Join Date: Jun 2003
Posts: 621
Default

PHP Code:
_global.x_pos _root._xmouse
This script means: delcare a variable x_pos to store the value of _root._xmouse at this time.

By that script, when _root._xmouse changes, the _xpos will not changes accordingly.

It does not mean that x_pos always "represents" the value of "_root._xmouse".
ericlin is offline   Reply With Quote
Old 07-30-2004, 03:13 PM   #8
androowzzz
Registered User
 
Join Date: Jun 2004
Posts: 28
Default

Ahh..I got it to work. Thanks
androowzzz is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:52 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.