Actionsript help?
- Started
- Last post
- 11 Responses
- unknown
Hey hey...I think my question is pretty simple, but my brain is even more simple.
I want to have an imaginary line running down the middle of my stage and have different cursors on either side. I have figured out to change the cursor, but that's about it.
Thanks in advance!
-k-fresh
- k770
man, that's a stumper. how do you draw an imaginary line in flash?
- unfittoprint0
imaginary line?
damn, I still haven't got to the 'Imaginary Actionscript' chapter...
be more clear...
- unknown0
hilarious!
- unknown0
Alright....too literal. I want the left side of my movie to display cursor 1, and the right side of my movie to display cursor 2.
- enobrev0
you're plannign to control both curesors at once?
- unknown0
Nope... I just want the cursor to change once the user moves the mouse onto the other side of the page.
So I need to know how to have different cursors within two different sets of coordinates.
- unfittoprint0
you could use this function inside your mouse movieclip:
changeMouse = function (){
if (_root._xmouse>Stage.width/2) {
gotoAndStop("right");
} else {
gotoAndStop("left");
}
}changeLoop = setinterval(this, "changeMouse", 30)
- mr_flaco0
When you set the cursor type, you should be able to say something like:
onEnterFrame{
if (/cursor._x/ > /half your movie size/){
/set cursorA/;
}else {
/set cursorB/;
}
}Of course this isn't the right syntax, but thats the general idea. I haven't done it - just a suggestion...
- shant0
Yeah, no need to set a loop or a function, just put this on the first frame of your cursor clip:
this.onEnterFrame = function(){
this._x > half ? this.gotoAndStop(1) : this.gotoAndStop(2);
}
stop();
- shant0
That looks fucked up there, but copy and paste it into flash and it'll look right.
- shant0
Oh, and "half" would have to be changed to the imaginary line location, and the cursor clip would have 2 frames, frame 1 has the first cursor and code, frame 2 has second cursor