Custom cursors not over flash ads?
- JackSmack
-
JackSmack
- Member since: Nov. 11, 2004
- Offline.
-
- Forum Stats
- Member
- Level 22
- Game Developer
Hey I am making a game with a custom cursor and I just noticed that it stops following the mouse when the mouse goes over an ad box in the game.
I was wondering why this is and if there is any way to fix it?
I have illustrated the problem below... any ideas?
- Redshift
-
Redshift
- Member since: Feb. 12, 2005
- Offline.
-
- Forum Stats
- Member
- Level 15
- Programmer
Well, what code did you use to simulate the custom cursor?
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
- JackSmack
-
JackSmack
- Member since: Nov. 11, 2004
- Offline.
-
- Forum Stats
- Member
- Level 22
- Game Developer
myCursor is the cursor clip and is on the timeline.
Here is the code...
Mouse.hide();
stage.addEventListener(MouseEvent.MOUSE_
MOVE, mouseMoveHandler);
stage.addEventListener(MouseEvent.MOUSE_
DOWN, mouseDownHandler);
stage.addEventListener(MouseEvent.MOUSE_
UP, mouseUpHandler);
function mouseMoveHandler(evt:MouseEvent):void
{
myCursor.visible = true;
myCursor.x = evt.stageX;
myCursor.y = evt.stageY;
}
function mouseDownHandler(evt:MouseEvent):void
{
myCursor.clip.gotoAndStop(2); // goto down state
}
function mouseUpHandler(evt:MouseEvent):void
{
myCursor.clip.gotoAndStop(1); // go to up state
}
stage.addEventListener(Event.MOUSE_LEAVE , mouseLeaveHandler);
function mouseLeaveHandler(evt:Event):void
{
myCursor.visible = false;
}
- the1manwiththeplan
-
the1manwiththeplan
- Member since: Jun. 10, 2008
- Offline.
-
- Forum Stats
- Member
- Level 17
- Blank Slate
Have you encountered this problem before.
Perhaps the distributor of the ad API has programmed it to prevent MCs covering its ad-space?
Perhaps you could try use a separate mouse just for the loading screen to eliminate the issue just using
onClipEvent (enterFrame) {
Mouse.hide();
this._x = _root._xmouse;
this._y = _root._ymouse;
}
If the separate loading screen mouse encounters the same problem perhaps my initial theory was correct...
...
- Lochie
-
Lochie
- Member since: Feb. 17, 2005
- Offline.
-
- Forum Stats
- Member
- Level 19
- Programmer
At 7/18/10 05:47 AM, the1manwiththeplan wrote: onClipEvent (enterFrame) {
Mouse.hide();
this._x = _root._xmouse;
this._y = _root._ymouse;
}
He appears to be using AS3.0 sir.
- MintPaw
-
MintPaw
- Member since: Jun. 11, 2006
- Offline.
-
- Forum Stats
- Member
- Level 10
- Programmer
Yeah dude, I think the API is designed to the point that it cannot be covered up by anything. If you try to cover it up at all your probably violating some rule.
- the1manwiththeplan
-
the1manwiththeplan
- Member since: Jun. 10, 2008
- Offline.
-
- Forum Stats
- Member
- Level 17
- Blank Slate
At 7/18/10 05:59 AM, Night-Mare wrote: He appears to be using AS3.0 sir.
Wooow shows how far my knowledge of AS stretches I wouldn't even know the first thing about that language lol
...
- JackSmack
-
JackSmack
- Member since: Nov. 11, 2004
- Offline.
-
- Forum Stats
- Member
- Level 22
- Game Developer
well it's not like the clip is moving behind the ad. It's like the movie clip just becomes dislodged from the mouse or like the mouse is no longer within the bounds of the flash at all.
The only thing I can think is that the ad is loaded on a different level like Level_0 and when you mouse over it the stage doesn't recognize that the mouse is within the bounds at all. I don't know though.



