|
| rozenrood |
Post
#1
|
|
Newbie Group: Members Posts: 4 Joined: 4-April 07 Member No.: 1,019 |
Hi,
I created a 3D world with dynamic placed flowers and bees.. I've plaeced the SWF online > http://www.rozenrood.nl/swf4/ Now the problem is as you can see, when you walk around a bit using the arrows on your keyboard, and you hover you mouse over a flower, sometimes strange things happends... i.e one second you'll see a flower high in the sky, the other second its gone, the same with bee's.. another strange thing is that sometimes the cube that is placed a cross the flower, got's very thick line instead of a nice thine one.. The flowers and bees are movieskins, and the cubes are mixedskins... how is this possible?? why are these strange things happening?? and how can I fix them (IMG:style_emoticons/default/smile.gif) hope someone can help me (IMG:style_emoticons/default/biggrin.gif) here is the code that places the flowers and cubes: CODE public function place(p_skin) { //places the flower var s:Object3D = new Sprite2D(); s.setSkin(p_skin); var tg1:TransformGroup = new TransformGroup(); var tg2:TransformGroup = new TransformGroup(); // var trans:Transform3D = new Transform3D(); var rot:Transform3D = new Transform3D(); // trans.translate(this.myValues.posX, 0, this.myValues.posY); rot.rot(0, Math.round(Math.random()*0), 0); // tg1.setTransform(rot); tg2.setTransform(trans); // tg1.addChild(s); tg2.addChild(tg1); _root.world.bg.addChild(tg2); // //plaatst de hover/click box cube = new Box(12, 12, 12, 'quad'); cube.setSkin(skinHoverOut); var tg3:TransformGroup = new TransformGroup(); var transBox:Transform3D = new Transform3D(); transBox.translate(this.myValues.posX-6, 27, this.myValues.posY-6); tg3.setTransform(transBox); tg3.addChild(cube); // //actions cube.enableEvents(true); cube.addEventListener(ObjectEvent.onRollOverEVENT, this, hoverIn); cube.addEventListener(ObjectEvent.onRollOutEVENT, this, hoverOut); cube.addEventListener(ObjectEvent.onPressEVENT, this, callViewDisplay, this.myValues.contentId); // Add the cube as a child to the rootGroup _root.world.bg.addChild(tg3); } |
| rozenrood |
Post
#2
|
|
Newbie Group: Members Posts: 4 Joined: 4-April 07 Member No.: 1,019 |
I've fixed the suddenly appearing flowers and bees by adjusting the camera's angle.. (not realy a fix but it works (IMG:style_emoticons/default/smile.gif) )
I've defined the skins within the class's constructor: CODE skinHoverIn = new MixedSkin(0xFF0000, 0, 0x999999, 100, 0.5); skinHoverOut = new MixedSkin(0xFF0000, 0, 0, 0, 0.5); both are defined as : CODE private var skinHoverIn:Skin; private var skinHoverOut:Skin; the hoverIn and -out methods are: CODE private function hoverIn(e:ObjectEvent) { cube.setSkin(skinHoverIn); cube.refresh(); if (!myHoverOutInt) { myHoverOutInt = setInterval(hoverOutInt, 3000, this); } } private function hoverOut(e:ObjectEvent) { cube.setSkin(skinHoverOut); cube.refresh(); clearInterval(myHoverOutInt); myHoverOutInt = 0; } private function hoverOutInt(target) { target.cube.setSkin(target.skinHoverOut); target.cube.refresh(); clearInterval(target.myHoverOutInt); target.myHoverOutInt = 0; } the hoverOutInt is called to be sure the hover is removed after 3 seconds |
| Lo-Fi Version | Time is now: 28th August 2007 - 11:54 AM |