Posted by: nullzeit Mar 30 2007, 03:41 PM
I
am working on a Flashsite for the Company Nortel. I want to build a
spinner that spinns on mouse movement, and that works fine.
Also
the different onRollover and Rollout stadiums are fine. But when i am
already over a face the eventhandler rollover will executed every
second when i move my mouse (but the mouse is still over the face and
the rollout event handler is not executed).
is this a bug in sandy or what?
you can watch the flash here: http://kunden.nullzeit.de/nortel/partner/nav.html
atteched is the complete code , and please don't scream when you see the code! It is not optimized ^^
here a lil bit of coude:
QUOTE
function createScene (bg:Group):Void
{
....
plane1.enableEvents(true);
plane1.addEventListener( ObjectEvent.onRollOverEVENT, this, setRollOverSkin_p1 );
plane1.addEventListener( ObjectEvent.onRollOutEVENT, this, setRollOutSkin_p1);
plane1.addEventListener(ObjectEvent.onPressEVENT, this, onPress_p1);
....
}
function setRollOverSkin_p1( e:ObjectEvent ){
this.nav_menuitem_8._alpha = 0;
this.nav_menuitem_2._alpha = 0;
p1_nav();
var obj:TriFace3D = e.getTarget();
var id = obj.getId();
var p1over_skin:BitmapData = BitmapData.loadBitmap('p1_over');
var p1over_skin_canvas:Skin = new TextureSkin (p1over_skin);
var p2_skin:BitmapData = BitmapData.loadBitmap('p2');
var p2_skin_canvas:Skin = new TextureSkin (p2_skin);
var p8_skin:BitmapData = BitmapData.loadBitmap('p8');
var p8_skin_canvas:Skin = new TextureSkin (p8_skin);
p2_skin_canvas.setLightingEnable(true);
p8_skin_canvas.setLightingEnable(true);
obj.setSkin( p1over_skin_canvas );
p1over_skin_canvas.setLightingEnable(true);
plane2.setSkin( p2_skin_canvas );
plane8.setSkin( p8_skin_canvas );
_global.test_var = 1;
}
Attached File(s)
spinner.as ( 57.45k )
Number of downloads: 1
Posted by: Petit Mar 30 2007, 10:56 PM
QUOTE(nullzeit @ Mar 30 2007, 03:41 PM)

is this a bug in sandy or what?
It is not optimized ^^
Humongous

And very readable.
Hey! And a beautiful spinner!
I made a test with only one Plane3D.
I also made a test with a single MovieClip.
Yes, it is a feat.. bug in Sandy.
The reason may be that the event listeners are reset for each frame ( kiroukou, are they ? ).
The solution I can see, isn't pretty:
In the onRollOverEVENT handler remove the onRollOverEVENT listener and add the onRollOutEVENT listener,
and vice versa. Admittedly very clumpsy.
Less so maybe in your upcoming optimized code