Hi all,
I’m working on a project but the ‘if’ statements aren’t working.
Can anyone help please?
here is the thingI have a scroll bar (scroll_mc) and inside it I have a dragable circle (circle_mc) and I have a content that is called (content_mc)
var _limit = new Rectangle(0,0,470,0) // -y, -x, +y, +x
var _position
var _divide = 35.2 // 720 (stage) * 25 (screens) 470 (scroll size)
function enter_frame(e){
_position = scroll_mc.circle_mc.x*_divide
content_mc.x= 0 - _position
}
scroll_mc.circle_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag_down)
function drag_down (e){
scroll_mc.circle_mc.startDrag(false,limite)
stage.addEventListener(Event.ENTER_FRAME, enter_frame)
}
stage.addEventListener(MouseEvent.MOUSE_UP, drag_up)
function drag_up (e){
** if (content_mc****.x > 0 && ****content****_mc****.x < 360){**
new Tween (content_mc, "x", Strong.easeInOut, content_mc.x, 0, 1 ,true);
}
**if (****content****_mc****.x > 360 && ****content****_mc****.x < 720){**
new Tween (content_mc, "x", Strong.easeInOut, content_mc.x, 720, 1 ,true);
}
**if (****content****_mc****.x > 720 && ****content****_mc****.x < 1080){**
new Tween (content_mc, "x", Strong.easeInOut, content_mc.x, 720, 1 ,true);
}
scroll_mc.circle_mc.stopDrag()
stage.removeEventListener(Event.ENTER_FRAME, enter_frame)
}
the problem is when I stop drag between 0 and 360 or 360 and 720 or 720 and 1080 nothing is happening and I need my content (content_mc) to reposition with the new tween event any ideas why?