Link to home
Start Free TrialLog in
Avatar of addmarketing

asked on

Triangle slider Volume control in Flex AS3 harder than it looks

I am trying to make a volume control slider in as3 my media player was built in flex and the effect I am trying to get is I have been working on this for like 4 days now so I am looking for help finally. I tried this many different ways and I still ahve no luck I got a version working in flash not flex but the drag was set on the mask of and it was useless because you couldnt turn the volume down does anyone have any idea how this is done?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="" layout="absolute">
	        import mx.managers.DragManager;
            import mx.core.DragSource;
            public var globeImage:Class;
            // The mouseMove event handler for the Image control
            // initiates the drag-and-drop operation.
            private function mouseMoveHandler(event:MouseEvent):void 
                var dragInitiator:Image=Image(event.currentTarget);
                var ds:DragSource = new DragSource();
                ds.addData(dragInitiator, "img");               
                DragManager.doDrag(dragInitiator, ds, event);
            // The dragEnter event handler for the Canvas container
            // enables dropping.
            private function dragEnterHandler(event:DragEvent):void {
                if (event.dragSource.hasFormat("img"))
		   private function dragDropHandler(event:DragEvent):void {
                Image(event.dragInitiator).x = 
                Image(event.dragInitiator).y = 
<mx:Canvas x="36" y="10" >
	<mx:Image x="152" y="192" source="assets/thumb.png" mask="{ maskImage }"/>
	<mx:Image x="152" y="205" source="assets/trackgrey.png" mouseMove="mouseMoveHandler(event);"/>
<mx:Image source="assets/thumb.png" x="518" y="10" mask="{ maskImage }">
<mx:Image source="assets/trackgrey.png" x="518" y="27" id="maskImage" cacheAsBitmap="true" mouseMove="mouseMoveHandler(event);">

Open in new window

Avatar of blue-genie
Flag of South Africa image

is it simply not doing the volume or is the whole thing not working i.e. the movement etc.
i'll copy your code over tonight and see if i can simulate it - don't have flex here at work.
Avatar of addmarketing


Its the movement, I got the movement working semi in flash bye making the mask drag-able but the issue was i couldn't drag the volume down unless I had moved the mouse over the mask the was all the way over the the right. If you could help me with this you would be a life saver, I can help you out with scripts and design work in exchange.
Avatar of addmarketing

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial