Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-03-2003, 03:37 AM   #1
Colin Campbell
Senior Member
 
Join Date: Jun 2003
Posts: 2,091
Default Would this work?

I was thinking of a code for a slider that on mouse would come to the button from which ever postition it was in before. Would this code work? Is there an easier way to do this? (I thought of this code by myself too )

ActionScript Code:
on (mouseOver) { // lets suppose the mc is at 300 on the x axis if (_root.myMovieClip._x => 300) { _root.mySlider._x++ } if (_root.myMovieClip._x <=300) { _root.mySlider._x-- } }
Colin Campbell is offline   Reply With Quote
Old 07-03-2003, 07:04 AM   #2
black
flashing vampire
 
black's Avatar
 
Join Date: Dec 2001
Location: nowhere
Posts: 1,406
Default

with this code your slider could move only once when mouse over event is occured, if you need continuous action try enterFrame event.

Regards~
black is offline   Reply With Quote
Old 07-03-2003, 07:40 AM   #3
annexion
I make out with chicks
 
Join Date: Oct 2002
Location: NYC
Posts: 1,586
Default

ActionScript Code:
on (mouseOver) {         // lets suppose the mc is at 300 on the x axis         if (_root.myMovieClip._x >= 300) {                 _root.mySlider._x++;         }else{                 _root.mySlider._x--;         } }

I fixed some of your syntax for you
__________________
www.perpetuated.com
annexion is offline   Reply With Quote
Old 07-03-2003, 10:18 PM   #4
Colin Campbell
Senior Member
 
Join Date: Jun 2003
Posts: 2,091
Default

will that work continuously?? I need it to work continuously to work.
Colin Campbell is offline   Reply With Quote
Old 07-03-2003, 11:02 PM   #5
Timmee_3Styler
Canadian Flasher
 
Join Date: May 2002
Location: T dot O dot
Posts: 1,651
Default

it will continiously work as long as your mouse is over that object
Timmee_3Styler is offline   Reply With Quote
Old 07-03-2003, 11:10 PM   #6
annexion
I make out with chicks
 
Join Date: Oct 2002
Location: NYC
Posts: 1,586
Default

No it won't.

This will however.

ActionScript Code:
on (mouseOver) {        _root.myMovieClip.onEnterFrame=function(){         if (_root.myMovieClip._x >= 300) {                 _root.mySlider._x++;         }else{                 _root.mySlider._x--;         } } }

But with that code, it's going to keep moving back and forth, if you want it to move, then stop the following will work:
ActionScript Code:
on (mouseOver) {        _root.myMovieClip.onEnterFrame=function(){         if (_root.myMovieClip._x >= 300) {                 _root.mySlider._x++;         }else{                 delete this.onEnterFrame;         } } }

Something like that, I'm lazy so it's not perfect. But, that should give you some direction.

Good luck.
__________________
www.perpetuated.com
annexion is offline   Reply With Quote
Old 07-03-2003, 11:20 PM   #7
Timmee_3Styler
Canadian Flasher
 
Join Date: May 2002
Location: T dot O dot
Posts: 1,651
Default

o fudge me........!!! i suck
Timmee_3Styler is offline   Reply With Quote
Old 07-03-2003, 11:20 PM   #8
Colin Campbell
Senior Member
 
Join Date: Jun 2003
Posts: 2,091
Default

How about an 'if, else if' statement? Like this:

ActionScript Code:
on (mouseOver) { _root.myMovieClip.onEnterFrame=Function () {         // lets suppose the mc is at 300 on the x axis         if (_root.mySlider._x => 300) {                 _root.mySlider._x++       } else if (_root.mySlider._x <=300) {                 _root.mySlider._x--         } } }

I think I'm getting alot better at actionscript after getting that book. I'm only on page 500 because I've been really busy, but I've already learned so much!
Colin Campbell is offline   Reply With Quote
Old 07-04-2003, 01:28 AM   #9
soup
Senior Member
 
soup's Avatar
 
Join Date: Apr 2003
Location: VT, usa
Posts: 231
Default

not to mention this service





soup
soup is offline   Reply With Quote
Old 07-04-2003, 02:22 AM   #10
Colin Campbell
Senior Member
 
Join Date: Jun 2003
Posts: 2,091
Default

lol, I haven't been on much. I've been really busy figuring stuff out. Golf, job, and this other forum I SMOD at just went through some tough times. Oh well, I'll be on more once this passes.
Colin Campbell 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 11:48 PM.


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