Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
ActionScript 3 Slider help
Old 12-15-2010, 03:26 PM ActionScript 3 Slider help
miki86's Avatar
Extreme Talker

Posts: 184
Location: print_r($serbia);
Trades: 0
Hello,
Is there a way to change frames back and forth with slider?
i've done it but it changes frames after the release of the mouse button.
Can this be done the other way?
I mean while im holding the mouse button.

Code:
function dragSlideDown(event:MouseEvent):void 
{
	mc_drag.startDrag(false, new Rectangle(mc_drag.x, 20, 0, mc_slide.height - mc_drag.height + 2));
	gotoAndStop(this.currentFrame + 3);
	stage.addEventListener(MouseEvent.MOUSE_UP, dragSlideUp);
}

function dragSlideUp(event:MouseEvent):void 
{
	mc_drag.stopDrag();
	stage.removeEventListener(MouseEvent.MOUSE_UP, dragSlideUp);
}
miki86 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-15-2010, 03:33 PM Re: ActionScript 3 Slider help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the onMouseUp event triggers on a complete cycle of a mouse button eg "click and release"

onMouseDown is the event you should use for the action you described.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-15-2010, 03:39 PM Re: ActionScript 3 Slider help
miki86's Avatar
Extreme Talker

Posts: 184
Location: print_r($serbia);
Trades: 0
Function named dragSlideDown is called by the onMouseDown
Code:
mc_drag.addEventListener(MouseEvent.MOUSE_DOWN, dragSlideDown);
But it looks like it get stuck here
Code:
mc_drag.startDrag(false, new Rectangle(mc_drag.x, 20, 0, mc_slide.height - mc_drag.height + 2))
Because everything after that (+3 frames) is executed after the release of a button
miki86 is offline
Reply With Quote
View Public Profile
 
Old 12-15-2010, 04:03 PM Re: ActionScript 3 Slider help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
My knowledge of actionscript is somewhat limited, but can an event listener remove itself while it is is occuring?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-15-2010, 04:26 PM Re: ActionScript 3 Slider help
miki86's Avatar
Extreme Talker

Posts: 184
Location: print_r($serbia);
Trades: 0
My knowledge is not much better, but it looks like it can.
I found this example, and this is exactly what i need except its ActionScript 2.
Already tried and it needs some modifications, but i think i can do something about it.

http://articles.sitepoint.com/articl...nimation-flash

Thanks Chris.
miki86 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to ActionScript 3 Slider help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31113 seconds with 12 queries