This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=431 as retrieved on 1 Aug 2007 13:00:06 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:_HI0SB5OlScJ:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D431+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=40


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ 3d Spinner and the onEvent handler problem

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)
Attached File  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 cool.gif 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 unsure.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)