Papervision - Object Inside A Collada File
Hello.How do i acsess a Object inside a collada file.I have tried Code: daeObject.getChildByName("object")) but with no sucsess.thxCode: package { import com.toky.BtnCamera; import flash.display.Sprite; import flash.display.Stage; import flash.events.Event; import org.papervision3d.cameras.Camera3D; import org.papervision3d.materials.ColorMaterial; import org.papervision3d.materials.utils.MaterialsList; import org.papervision3d.objects.DisplayObject3D; import org.papervision3d.objects.parsers.DAE; import org.papervision3d.render.BasicRenderEngine; import org.papervision3d.scenes.Scene3D; import org.papervision3d.view.Viewport3D; public class Pulitzer3d extends Sprite { public var viewport:Viewport3D; public var renderer:BasicRenderEngine; public var scene:Scene3D; public var camera:Camera3D; public var dae:DAE; public var cm:ColorMaterial; public var holder:DisplayObject3D; public var cameraBtn:BtnCamera; public function Pulitzer3d() { init(); } private function init() { //basic scene stuff viewport = new Viewport3D(1024, 768, true,true); addChild(viewport); renderer = new BasicRenderEngine(); scene = new Scene3D(); camera = new Camera3D(holder, 15, 100); camera.zoom = 500; camera.z = -50; //COLOR MATERIAL cm = new ColorMaterial(0xFF0099, .85, true); //DAE dae = new DAE(); dae.load("floor.dae", new MaterialsList( { all:cm } )); holder = new DisplayObject3D(); holder.addChild(dae); trace("HELO : " + holder.getChildByName("8")) holder.rotationX = 90; holder.rotationY = 45; scene.addChild(holder); stage.addEventListener(Event.ENTER_FRAME, renderStuff); //SETUP BUTTON cameraBtn = new BtnCamera(camera); addChild(cameraBtn); } private function renderStuff(e:Event) { renderer.renderScene(scene,camera,viewport,true); //camera.x += (((stage.mouseX-(stage.stageWidth * .5))*2)-camera.x )*.05; //camera.y += (((stage.mouseY-(stage.stageHeight*.5))*2)-camera.y )*.05; } }}
Actionscript 3.0
Posted on: Wed Sep 24, 2008 11:22 am
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Papervision, Collada, And Swf Materials
i'm trying to map a swf file (loaded at run time) onto a collada sphere.
The swf loads fine and appears to map onto the sphere, but the mapping is all off. and looks terrible.
What could I be doing wrong?
Here's my code
Code:
var mc:MovieClip = new MovieClip();
var matLoader:Loader = new Loader();
matLoader.load(new URLRequest("Anim_sequence2.swf"));
mc.addChild(matLoader);
var mm:MovieMaterial = new MovieMaterial(mc);
mm.doubleSided = true;
mm.animated = true;
mm.smooth = true;
// Materials List Setup
var mL:MaterialsList = new MaterialsList();
mL.addMaterial(mm, "_1_-_Default");
// Create Collada Sphere
var cSphere:Collada = new Collada("colladaball64_35.DAE", mL, 1, true);
scene.addChild(cSphere);
Papervision Collada Problem
hey,
after I saw lee's tutorial about papervision I went experimenting with it, but I got stuk when trying to display a object that I made in maya.
first I tried to export my scene to a .ase file and displayed it in flash using actionscript but the object get's displayed totaly weird.
than i tried to export my scene to a .dae file an tried to display it in flash but this time I get several errors:
Collada material lambert2SG not found.
Papervision 2 Collada Verticies Info
Hi,
I want to import a collada into flash and find out how many verticies, faces, size etc, the collada object contains. Is this possible with pv3d?
Cheers
Papervision Acsess Individual Object Within .dae File/Object
Hello,
The following code loads a .dae file into a new DAE() Object i am trying to acsess a specific child within de Object called "Loja1" (one of many) with var storeisplayObject3D = holder.getChildByName("Loja1"); to individually rotate it etc... but with no sucsess.
Does anyone know how this is acomplished ?
Thanks in Advance.
files at : http://www.kiyoshii.com/transfer/src.zip
Code:
package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
public class Pulitzer3d extends Sprite {
public var viewport:Viewport3D;
public var renderer:BasicRenderEngine;
public var scene:Scene3D;
public var camera:Camera3D;
public var dae:DAE;
public var cm:ColorMaterial;
public var holder:DisplayObject3D;
public var cameraBtn:BtnCamera;
public function Pulitzer3d() {
init();
}
private function init() {
//basic scene stuff
viewport = new Viewport3D(1024, 768, true,true);
addChild(viewport);
renderer = new BasicRenderEngine();
scene = new Scene3D();
camera = new Camera3D(holder, 15, 100);
camera.zoom = 500;
camera.z = -50;
//COLOR MATERIAL
cm = new ColorMaterial(0xFF0099, .85, true);
//DAE
dae = new DAE();
dae.load("floor_rename.dae", new MaterialsList( { all:cm } ));
holder = new DisplayObject3D();
holder.addChild(dae);
holder.rotationX = 90;
holder.rotationY = 45;
scene.addChild(holder);
var store:DisplayObject3D = holder.getChildByName("Loja1");
trace("DAE : " + store);
stage.addEventListener(Event.ENTER_FRAME, renderStuff);
}
private function renderStuff(e:Event) {
renderer.renderScene(scene,camera,viewport,true);
//camera.x += (((stage.mouseX-(stage.stageWidth * .5))*2)-camera.x )*.05;
//camera.y += (((stage.mouseY-(stage.stageHeight*.5))*2)-camera.y )*.05;
}
}
}
AS3 - Papervision Acsess Individual Object Within .dae File/Object
Hello,
The following code loads a .dae file into a new DAE() Object i am trying to acsess a specific child within de Object called "Loja1" (one of many) with var store: DisplayObject3D = holder.getChildByName("Loja1"); to individually rotate it etc... but with no sucsess.
Does anyone know how this is acomplished ?
Thanks in Advance.
files at : http://www.kiyoshii.com/transfer/src.zip
Code:
package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
public class Pulitzer3d extends Sprite {
public var viewport:Viewport3D;
public var renderer:BasicRenderEngine;
public var scene:Scene3D;
public var camera:Camera3D;
public var dae:DAE;
public var cm:ColorMaterial;
public var holder:DisplayObject3D;
public var cameraBtn:BtnCamera;
public function Pulitzer3d() {
init();
}
private function init() {
//basic scene stuff
viewport = new Viewport3D(1024, 768, true,true);
addChild(viewport);
renderer = new BasicRenderEngine();
scene = new Scene3D();
camera = new Camera3D(holder, 15, 100);
camera.zoom = 500;
camera.z = -50;
//COLOR MATERIAL
cm = new ColorMaterial(0xFF0099, .85, true);
//DAE
dae = new DAE();
dae.load("floor_rename.dae", new MaterialsList( { all:cm } ));
holder = new DisplayObject3D();
holder.addChild(dae);
holder.rotationX = 90;
holder.rotationY = 45;
scene.addChild(holder);
var store:DisplayObject3D = holder.getChildByName("Loja1");
trace("DAE : " + store);
stage.addEventListener(Event.ENTER_FRAME, renderStuff);
}
private function renderStuff(e:Event) {
renderer.renderScene(scene,camera,viewport,true);
//camera.x += (((stage.mouseX-(stage.stageWidth * .5))*2)-camera.x )*.05;
//camera.y += (((stage.mouseY-(stage.stageHeight*.5))*2)-camera.y )*.05;
}
}
}
Papervision Acsess Individual Object Within .dae File/Object
Hello,
The following code loads a .dae file into a new DAE() Object i am trying to acsess a specific child within de Object called "Loja1" (one of many) with var store:DisplayObject3D = holder.getChildByName("Loja1"); to individually rotate it etc... but with no sucsess.
Does anyone know how this is acomplished ?
Thanks in Advance.
files at : http://www.kiyoshii.com/transfer/src.zip
Code:
package {
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
public class Pulitzer3d extends Sprite {
public var viewport:Viewport3D;
public var renderer:BasicRenderEngine;
public var scene:Scene3D;
public var camera:Camera3D;
public var dae:DAE;
public var cm:ColorMaterial;
public var holder:DisplayObject3D;
public var cameraBtn:BtnCamera;
public function Pulitzer3d() {
init();
}
private function init() {
//basic scene stuff
viewport = new Viewport3D(1024, 768, true,true);
addChild(viewport);
renderer = new BasicRenderEngine();
scene = new Scene3D();
camera = new Camera3D(holder, 15, 100);
camera.zoom = 500;
camera.z = -50;
//COLOR MATERIAL
cm = new ColorMaterial(0xFF0099, .85, true);
//DAE
dae = new DAE();
dae.load("floor_rename.dae", new MaterialsList( { all:cm } ));
holder = new DisplayObject3D();
holder.addChild(dae);
holder.rotationX = 90;
holder.rotationY = 45;
scene.addChild(holder);
var store:DisplayObject3D = holder.getChildByName("Loja1");
trace("DAE : " + store);
stage.addEventListener(Event.ENTER_FRAME, renderStuff);
}
private function renderStuff(e:Event) {
renderer.renderScene(scene,camera,viewport,true);
//camera.x += (((stage.mouseX-(stage.stageWidth * .5))*2)-camera.x )*.05;
//camera.y += (((stage.mouseY-(stage.stageHeight*.5))*2)-camera.y )*.05;
}
}
}
Width And Height Of Collada/dae Object
Im trying to access the width and height of a dae/collada object.
myDAE.width does not work. If you have any ideas as to which class this info is contained it would be a massive help!
Cheers
Collada Object's Vertices PV3D
How do you access a Collada Object's Vertices in papervision? I'm trying geometry.vertices.length and it results in an error. I imported in import org.papervision3d.core.geom.* as well.
Code:
stuObject = new Collada("shape.dae", myMaterialList);
default_scene.addChild(stuObject);
trace(stuObject.geometry.vertices.length);
Incomplete Rendering Of Collada Object
I have a crude model that has some basic camera and tweening functionality applied to it in PV 3D. The model doesn.t seem to render properly at all camera and rotation angles. I'm wondering if anyone else has the same problem or is there a property I may have missed. Link to movie and code below.
http://myacc.net/~pperuzzi/bin-releaseC ... Plane.html
package {
//import statements
import caurina.transitions.*;
import com.perlzmedia.assets.ui.GlowButton;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.Collada;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
//Set stage metadata properties
[SWF(width="800", height="600", backgroundColor="#000000", frameRate="30")]
public class ColladaPlane extends Sprite
{
//Declare 3D elements
private var scene:Scene3D;
private var camera:Camera3D;
private var renderer:BasicRenderEngine;
private var viewport:Viewport3D;
private var coPlane:DisplayObject3D;
public function ColladaPlane()
{
//Declare, instantiate, register and set properties
scene = new Scene3D();
camera = new Camera3D;
camera.zoom = 125;
camera.focus = 10;
renderer = new BasicRenderEngine;
viewport = new Viewport3D(0, 0, true, true);
addChild(viewport);
coPlane = new Collada("assets/Plane.dae");
scene.addChild(coPlane);
coPlane.rotationX = 320;
coPlane.rotationZ = 320;
coPlane.rotationY = 45;
var bgReq:URLRequest = new URLRequest("assets/hk.jpg");
var bgLdr:Loader = new Loader();
bgLdr.load(bgReq);
addChildAt(bgLdr, 0);
var btn:GlowButton = new GlowButton("assets/btn_down.png");
addChildAt(btn, 1);
btn.x = 675;
btn.y = 545;
//Event listeners
addEventListener(Event.ENTER_FRAME, onEnterFrame);
btn.addEventListener(MouseEvent.CLICK, onBtnClick);
}
//Functions
private function onEnterFrame(e:Event):void {
renderer.renderScene(scene, camera, viewport);
coPlane.yaw(2);
camera.hover(1, (300-mouseX)*.005, (300-mouseY)*.005);
}
private function onBtnClick(e:MouseEvent):void {
var ran:Number = Math.random()* 1000 - 400;
Tweener.addTween(coPlane,{x:ran, rotationX:ran, y:ran, rotationY:ran, z:ran, rotationZ:ran,
time:1, transition:"easeOutElastic"});
}
}
}
PV3D: ShadedMaterial On A Collada File
i'm doing a materialtest with papervision, using some collada-objects that i load with the DAE-class. one thing that i didnt get to work is creating a shadedmaterial, not a shader as a material but combining a shader and my original material (loaded with the collada-file) into a new material. i dont get any errors, and when i look at examples i think i'm doing the right things, although the examples always create a new object from scratch (and add the ShadedMaterial to the fresh materialslist).
What i do is load the objects, store their materials in an array (i clone them once they're loaded), and use this object-loop to create the shadedmaterial and replace it with its original
var shader:FlatShader = new FlatShader(light, 0xFFFFFF, 0x222222);
for each(var obj: DAE in this.objects)
{
var orgMat:BitmapMaterial = this.original_materials[obj.name];
var material:MaterialObject3D = new ShadedMaterial(orgMat, shader);
obj.replaceMaterialByName(material, "Default");
}
The original materials are actually BitmapFileMaterials, but since that's a subclass of BitmapMaterial i think that should work just fine. You can see my test here, every material works except for the flatshaded+bitmap, when i use that one my framerate drops dramatically but i dont see any change.
http://dl.getdropbox.com/u/250155/pv3dtest/main.html
Does anybody have any ideas on why this isnt working?
How To Load XML File Inside Object Method
Hi,
I am able to load an XML file but now I want to make my code cleaner and I want to do it inside the constructor of an object.
Loading an XML file happens in 2 steps :
1. start the loading by
myXMLdoc.load("example.xml");
2. Flash indicates it has finished loading by calling the myXMLdoc.onLoad() function.
How do I declare/define the onLoad event handler inside a class definition ??
Here is my class code so far (generating an error around the onLoad function) :
I am calling the aSiteXMLDoc.load method in the constructor, and I tried to point the aSiteXMLDoc.onLoad handler to the 'this.load' method... but the compiler doesn't like it this way :-(
Attach Code
class myclasses.site{
var aSiteXMLDoc:XML;
var h1s:Array = new Array();
public function site(aSiteDocFileName:String) {
aSiteXMLDoc = new XML();
aSiteXMLDoc.ignoreWhite = true;
aSiteXMLDoc.onLoad = this.load(success);
aSiteXMLDoc.load(aSiteDocFileName);
}
public function load(success):Void {
if (success) {
var aNode:XMLNode = aSiteXMLDoc.firstChild;
while (aNode != null) {
this.addh1(aNode);
aNode = aNode.nextSibling;
}
}
}
public function addh1(aNode:XMLNode):Void {
var new_h1:myclasses.h1 = new myclasses.h1();
new_h1.title="test title";
new_h1.colorscheme="nice";
h1s.push(new_h1);
}
public function draw():Void {
for (var x:Number=0; x<h1s.length; x++) {
h1s[x].draw();
}
}
}
Button Inside Moviemateriel In Papervision
Code:
var mam:MovieMaterial = new MovieMaterial(new clip);
mam.interactive = true;
mam.smooth = true;
mam.animated = false;
//mam.doubleSided = true;
var plano = new Plane(mam, 300,200, 2, 2);
How I put action in a button inside the movieclip (CLIP) named BT1
Thanks and sorry for my english
Cant Click Object In Papervision
I am trying to make an object clickable in pv3d and its just not working out for me. This is what I have. A basic plane that I want to click on:
ActionScript Code:
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;
import org.papervision3d.events.InteractiveScene3DEvent;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.BitmapAssetMaterial;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
var camera:Camera3D;
var scene:Scene3D;
var viewport:Viewport3D;
var renderer:BasicRenderEngine;
var wall:Plane;
init();
function init()
{
viewport = new Viewport3D(0, 0, true, true, false);
addChild(viewport);
renderer = new BasicRenderEngine();
scene = new Scene3D();
camera = new Camera3D();
var wallMaterial:BitmapAssetMaterial = new BitmapAssetMaterial("Wall");
wall = new Plane(wallMaterial,200,200,3,3);
wall.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, shakeMe);
scene.addChild(wall);
addEventListener(Event.ENTER_FRAME, drawScene);
}
function shakeMe(e:InteractiveScene3DEvent):void
{
trace("clicked");
}
function drawScene(e:Event):void
{
renderer.renderScene(scene, camera, viewport);
}
AS3 - Papervision : Wall Collision Inside A Scenario (hit Test)
Hello everybody!
I'm trying to build a game-like Scenario with an object ("player") inside a Room (Cube).
The thing is, when i use hitTestObject or hitTestPoint in order to tell when my character has hit a wall, the fact that hitTest is using a boundingSphere shape to calculate hits, is not allowing my character to get nowhere near none of the four corners of the room.
What I tried next to that, is using planes for walls (insted of just a simple cube). This looks much better, in fact, when trying to build more complex scenarios later on, it seems like the correct choice for achieving that.
The problem i am getting now is this:
taking one wall as target; even though my object is inside the cube, I noticed that hittest is giving true for that wall, but as soon as i get somewhere far that same wall (still being inside my "room"), hittest returns (unexplainably) false...
any directions on this??
any other way to resolve wall collision events?
thanks a lot.
Papervision: Does An Object Get Rendered And Uses Processing
My scene is a carrousel and it contains too many objects in view of the camera. I will move the camera so that onlt a few bjects are in the sight line of the camera. Will this reduce the procesing that takes place? I would like to cull the objects which are outside of the view of the camera without being as brutal as to 'removeChild' them from the scene. How could I achieve a more efficient scene, or can someone clarify how much of the scene is processed outside of the cameras view? Many thanks in advance.
Best Way To Make A Rotating Object Using Papervision
Hi there,
I am trying to figure out the best way to make a floating, rotating object. The object would be a triangular pen (being 3 sided). I figured I could use papervision3D, and possible create an object that would be a pyramid, but I'm not sure how I would make the pyramid... I was thinking using the plane class?
If anybody could suggest any tutorials or blogs where I could check it out, it would be greatly appreciated!
Thanks!
Papervision: Does An Object Get Rendered And Uses Processing
My scene is a carrousel and it contains too many objects in view of the camera. I will move the camera so that only a few objects are in the sight line of the camera. Will this reduce the processing that takes place? I would like to cull the objects which are outside of the view of the camera without being as brutal as to 'removeChild' them from the scene. How could I achieve a more efficient scene, or can someone clarify how much of the scene is processed outside of the cameras view? Many thanks in advance.
Problems Getting A Button Inside A Movieclip Texture For A Papervision Model, To Set
Hi all,
Decided yesterday it was about time I got my arse into gear and started making the switch to as3.
Having real problems getting a button inside a movieclip texture for a papervision model, to set properties to a clip on the main timeline. I've looked all over the place for answers, but nothing explaining exactly (in it's simplest form) how to do this. I gather it's something to do with declaring the clip, or making it an object, but everything I try gives me errors.
Just need this button within a clip, to say, change the alpha of another clip thats on the main root timeline.
please help!
Applying A Drawn Object/movieclip Onto Papervision
Hi guys,
I'm about to start looking into a design problem for a project, but thought I'd start here to see if anyone has any suggestions on which way is the best to go before I start going into it myself.
What I intend to do, is have a draw API interface where the user is able to draw onto a mesh block (a limited area that can be drawn on/object dropped on-- for example a face, so could have premade objects such as eyes/mouth etc already made).
Then after this I'd plan 2 things to happen,
Firstly the aim is to be able to take this drawing and apply it to a surface within papervision 3d.
Secondly is to be able to apply it to a printable net.
If you're wondering what the hell I'm trying to do, basically the user can create a character that is simeltaneously a printable net (which can then be made into a standalone box form with the character printed on it). Ideally simeltaneously id aim to present what the net would look like by using papervision 3d in realtime.
So, what recommendations have people got on best place to start and what to look into? The main design challenge would be converting the drawn object space into an object that can be placed on the net as well as viewed directly in 3d.
Cheers,
Adam
Custom Class That Creates A Papervision Object
Hello-
So, I'm familiar with the basics of Papervision. I feel comfortable creating planes, spheres, applying materials, rotating, moving..etc.
This is all good, however, I'm having trouble wrapping my head around the workflow of the following task I created for myself:
I'd have a number of photos I'd like to bring in, apply as a material to a plan and then apply whatever animations/events.
If I were not using Papervision, I'd create a Photo class and pass in the path to the photo, then create a sprite, load the photo into it, and the class would take care of add it to the stage, setting up the events..etc.
However, with Papervision, I'm not sure the proper way to go about this.
For instance, what would this Photo class extend? Previously, it was a Sprite. Would it be a Plane?, or DisplayObject3d?
Then, in my document class, what would be the proper way of creating these? Currently, I have a loop set up to create all the Photo objects. Would it be best to add it to the Scene in the document class or in the Photo Class?
Hopefully this isn't too vague. There are a lot of great papervision tutorials, but they don't seem to go into detail of class management. So any help would be greatly appreciated!
Thanks!
Double Sided Flipping Object With Papervision 2.0 Help
so I have this class that creates this object with papervision and places it on the stage, it loades to images into the scene and i cant figure out how to make on image appear on the fron and the other on the back. here is my code, let me know if you can help, Thanks.
ps. im building this in flex/flash and using it as a document class file.
Code:
package {
import caurina.transitions.Tweener;
import flash.display.*;
import flash.events.Event;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.events.InteractiveScene3DEvent;
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
public class PV3D extends Sprite {
private var viewport:Viewport3D;
private var scene:Scene3D;
private var camera:Camera3D;
private var material:ColorMaterial;
private var primitive1:Plane;
private var primitive2:Plane;
private var renderer:BasicRenderEngine;
private var rotY:Number;
private var bmp1:BitmapFileMaterial;
private var bmp2:BitmapFileMaterial;
public function PV3D():void {
var counter:Boolean = true;
//viewport = new BasicRenderEngine(width, height, scaleToStage, interactive);
viewport = new Viewport3D(550, 400, false, true);
addChild(viewport);
//instantiates a Scene3D instance
scene = new Scene3D();
//instantiates a Camera3D instance
camera = new Camera3D();
camera.zoom = 5;
//renderer draws the scene to the stage
renderer = new BasicRenderEngine();
//for (var i:uint = 0; i <= 5
bmp1 = new BitmapFileMaterial("yP.gif");
bmp2 = new BitmapFileMaterial("yO.gif");
bmp1.interactive = true;
bmp2.interactive = true;
//ColorMaterial, doubleSided draws the color on both sides of the geometry normals
material = new ColorMaterial(0x333333);
material.doubleSided = true;
//primitive = new Plane(material applied to object, width, height, wSegments, hSegments);
primitive1 = new Plane(bmp1, 200, 200, 10, 10);
primitive2 = new Plane(bmp2, 200, 200, 3, 3);
bmp1.doubleSided = true;
bmp2.doubleSided = true;
scene.addChild(primitive1);
scene.addChild(primitive2);
//set up enterFrame event
addEventListener(Event.ENTER_FRAME, _onEnterFrame);
primitive1.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, onClick);
primitive2.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, onClick);
primitive1.z = 1;
primitive2.z = -1;
//define enterFrame Method, render the PV3D Scene and animate the primitive
function _onEnterFrame(e:Event):void {
//primitive1.rotationY += rotY;
//primitive2.rotationY += rotY;
renderer.renderScene(scene, camera, viewport);
}
function onClick(e:InteractiveScene3DEvent):void {
//bmp1.interactive = false;
if(counter) {
primitive2.z = -1;
primitive1.z = 1;
Tweener.addTween(primitive1, {rotationY:180, time:1.5, transition:"easeInOutBack", onComplete: function () {trace("done")}} );
Tweener.addTween(primitive2, {rotationY:180, time:1.5, transition:"easeInOutBack", onComplete: function () {trace("done")}} );
counter = false;
}else {
primitive2.z = 1;
primitive1.z = -1;
counter = true;
Tweener.addTween(primitive1, {rotationY:e.target.rotationY - 180, time:1.5, transition:"easeInOutBack", onComplete: function () {trace("done")}} );
Tweener.addTween(primitive2, {rotationY:e.target.rotationY - 180, time:1.5, transition:"easeInOutBack", onComplete: function () {trace("done")}} );
}
}
}
}
}
Custom Class That Creates A Papervision Object
Hello-
So, I'm familiar with the basics of Papervision. I feel comfortable creating planes, spheres, applying materials, rotating, moving..etc.
This is all good, however, I'm having trouble wrapping my head around the workflow of the following task I created for myself:
I'd have a number of photos I'd like to bring in, apply as a material to a plan and then apply whatever animations/events.
If I were not using Papervision, I'd create a Photo class, create it, pass in the path to the photo and the class would take care of preloading, setting up the events..etc.
However, with Papervision, I'm not sure the proper way to go about this.
For instance, what would this Photo class extend? Previously, it was a Sprite. Would it be a Plane?, or DisplayObject3d?
Then, in my document class, what would be the proper way of creating these? Currently, I have a loop set up to create all the Photo objects. Would it be best to add it to the Scene in the document class or in the Photo Class?
Hopefully this isn't too vague. There are a lot of great papervision tutorials, but they don't seem to go into detail of class management. So any help would be greatly appreciated!
Thanks!
Papervision 3D / SWF File Size
I'm currently working for a client that want to try out PV3D in banners and I'm having problems meeting the demands on the low file sizes for those (30-50kb). The main part of those kb's seems to be added when setting up the scene, camera, renderer etc, before any of my visible objects are added. I understand the basic stuff in PV3D must be quite extensive, but I'll give it a shot anyways:
Does anyone of you guys know if there's any way of getting my compiled SWF smaller or if there's any compression method available?
Thanks in advance!
Web Service Param Is An Object Inside And Array Which Is An Object
Howdy. This is my first time on this forum, and I hope I get more help here than some of the other forums. I'll try to explain my dillema as simply as possible.
I have a webservice. I am calling a method 'InsertSlide'. That method requires and object as the paramater.
the object shcema looks like this:
Object
-SlideID (integer)
-Name (integer)
-SlideTypeID (integer)
-Hits (integer)
-LocationID (integer)
-SwfFileName (integer)
-SlideDataCollection (Array)
- -N (Object)
- - -Label
- - -Value
I hope that makes sense, all I'm trying to get at, is there is an object with an array as a property, that array is populated with an object and it has properties.
I recieve that same ojbect from the webservice fine, but when I send that object like that to the Webservice it does not fully populate my databases, unfortunatly I did not write the webservice.
Is it possible that the problem is the webservice? or flash?
Thanks for any help!
- Kiwi
Targeting Object Properties Inside PopUp Object
In my project I am creating a window using the PopUpManager. The symbol used to create that window has several objects.
For the sake of discussion we'll discuss the object message_txt inside myWindow.
How do I reference message_txt.text from actionscript after the object is dynamically created?
Help With Papervision Sphere And External SWF File Material
Hi all,
I have problemm, maybe someone knows solution.
I need to put external SWF file as a material on Sphere in Papervision.
I wrote those lines, but it's not working :
Code:
var loader:Loader = new Loader();
var req:URLRequest = new URLRequest("001.swf");
loader.load(req);
var movieClip:MovieClip = new MovieClip();
movieClip.addChild(loader);
var txt:TextField = new TextField();
txt.text = "asdasdasddfsdfkjha flkashgd fafsdfasdf";
movieClip.addChild(txt);
var movieMaterial:MovieMaterial = new MovieMaterial(movieClip);
movieMaterial.interactive = true;
movieMaterial.doubleSided = true;
movieMaterial.smooth = true;
// Create Sphere
sphere = new Sphere(movieMaterial,1000,40,40);
sphere.rotationY = sphere_start_rotation; // Set up sphere rotation point startup position;
scene.addChild(sphere);
renderer.renderScene(scene, camera, viewport);
But I can not see nothig, I think there is error or I'm doing something wrong.
Please Help me with it.
Papervision3D , Help With Collada
I have a problem when importing collada (.dae ) files in Flash ( Papervision3D ) .
Firstly i Import all i need for collada:
Code:
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.Collada;
Then i have a variable for it :
Code:
private var Tube01:Collada;
And then i import it , add to scene , and i place it where i want:
Code:
Tube01 = new Collada("Tube01.dae");
scene.addChild(Tube01);
Tube01.z = -800;
Tube01.x = 0;
Tube01.y = 0;
I have other codes too , but i this is only the code for collada ...
When i test the movie , i see all other things , but i cant see collada file i imported ?? And in output it says :
Quote:
DisplayObject3D: Tube01
BitmapFileMaterial: Loading bitmap from t3.jpg
When i try a collada file wich i import directly from internet . It works OK
Anyone knows why isnt this working ????
PS: I looked for forum for papervision3d in flashkit but i didnt find so i posted it here
EDIT : I dont know if i am doing something wrong when i export my collada file from 3dmax ... For exporting it i use ColladaMax Plugin
I really have no idea
X,y,z Properties Of Collada
Hello,
I am trying to get the x,y and z properties of a collada imported into Flash using Papervision 2.0. I have managed to get the vertices and faces data of the collada from the .DAE class. If I do : colladaFile.x , 0 is returned. If anyone knows what class and function this information is stored, I could probably figure out how to extract the information into my Flash file.
Thanks
Multiple Collada Loading
I have to display multiple Collada objects in a scene whos' individual information is listed in an XML document as nodes. Heres what needs to happen:
1. Store item 'titles' and 'ids' inside an array from an XML document. (I think I have this part working and ready)
2. The data from the XML is then used to generate paths to Collada files. Path example: new Collada = "items/" + itmeName + itemID ".dae";
3. A function is called upon to construct each unique Collada instance for every item in the XML using path data from the array.
The bit that has me stumped is how to fit all these together? I need help with a function that takes the data in the array, acts as a path finder and constructer for each item in the library. I suppose this is kind of like when an AS3 XML driven menu is built. You take the data and then have a function that adds event listeners and text bodys for each instance. If I've explained this badly, or you wish to see some code, please just let me know!
Thanks
Multiple Collada Loading
I have to display multiple Collada objects in a scene whos' individual information is listed in an XML document as nodes. Heres what needs to happen:
1. Store item 'titles' and 'ids' inside an array from an XML document. (I think I have this part working and ready)
2. The data from the XML is then used to generate paths to Collada files. Path example: new Collada = "items/" + itmeName + itemID ".dae";
3. A function is called upon to construct each unique Collada instance for every item in the XML using path data from the array.
The bit that has me stumped is how to fit all these together? I need help with a function that takes the data in the array, acts as a path finder and constructer for each item in the library. I suppose this is kind of like when an AS3 XML driven menu is built. You take the data and then have a function that adds event listeners and text bodys for each instance. If I've explained this badly, or you wish to see some code, please just let me know!
Thanks
Multiple Collada Loading
I have to display multiple Collada objects in a scene whos' individual information is listed in an XML document as nodes. Heres what needs to happen:
1. Store item 'titles' and 'ids' inside an array from an XML document. (I think I have this part working and ready)
2. The data from the XML is then used to generate paths to Collada files. Path example: new Collada = "items/" + itmeName + itemID ".dae";
3. A function is called upon to construct each unique Collada instance for every item in the XML using path data from the array.
The bit that has me stumped is how to fit all these together? I need help with a function that takes the data in the array, acts as a path finder and constructer for each item in the library. I suppose this is kind of like when an AS3 XML driven menu is built. You take the data and then have a function that adds event listeners and text bodys for each instance. If I've explained this badly, or you wish to see some code, please just let me know!
Thanks
Multiple Collada Loading
I have to display multiple Collada objects in a scene whos' individual information is listed in an XML document as nodes. Heres what needs to happen:
1. Store item 'titles' and 'ids' inside an array from an XML document. (I think I have this part working and ready)
2. The data from the XML is then used to generate paths to Collada files. Path example: new Collada = "items/" + itmeName + itemID ".dae";
3. A function is called upon to construct each unique Collada instance for every item in the XML using path data from the array.
The bit that has me stumped is how to fit all these together? I need help with a function that takes the data in the array, acts as a path finder and constructer for each item in the library. I suppose this is kind of like when an AS3 XML driven menu is built. You take the data and then have a function that adds event listeners and text bodys for each instance. If I've explained this badly, or you wish to see some code, please just let me know!
Thanks
Papervision3D / Collada Materials
I'm using the latest Papervision3D + Collada for importing my geometry
The problem I'm having is getting my MaterialsList to work in my Actionscript.
I have a movieClip animation that I want to apply as a material to my object that I import using Collada.
I'm pulling my hair out because there doesn't seem to be any good documentation examples for this.
How do I apply my materials using MaterialsList?
C4D Collada Problem - PV3D
Anyone using Collada files from Cinema 4D for Papervision?
Supposedly this problem was fixed from within PV but Im still having major issues with it. The model loads fine but if there is more than one object in the scene it applies the first material to all of them rather than their respective ones.
My output in flash says this:
Code:
INFO: BitmapFileMaterial: Loading bitmap from BodySurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from HeadSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from ShaftSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from TipSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from WheelsSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from WingSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from HeadSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from WheelsSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from ShaftSurface_Color.png
INFO: BitmapFileMaterial: Loading bitmap from WingSurface_Color.png
INFO: using input set #0 for material Material1
INFO: using input set #0 for material Material1
INFO: using input set #0 for material Material1
INFO: using input set #0 for material Material1
INFO: using input set #0 for material Material1
INFO: using input set #0 for material Material1
INFO: DisplayObject3D: COLLADA_Scene
INFO: DisplayObject3D: Wing
INFO: DisplayObject3D: Wheels
INFO: DisplayObject3D: Tip
INFO: DisplayObject3D: Shaft
INFO: DisplayObject3D: Head
INFO: DisplayObject3D: Body
When I look inside the collada file I see "Material1" used a lot in places where I think there should be proper material names from the 3d program.
Ive attached the DAE and the textures if anyone can help, this was all working fine from the same model exported from Maya so I have a feeling its bad exporting from c4d.
any help would be awesome!!!!!
Interactive Material On Collada
I can't get this material on a Collada inside a MaterialsList to be interactive. It worked on a plane outside of the MaterialsList, but now it doesn't hit the function. There aren't any errors, just the event doesn't work... Any ideas? (using greatwhite)
Code:
materialTwo.interactive = true;
materialTwo.name = "front";
materialTwo.smooth = true;
materialTwo.doubleSided = true;
var myMaterialList:MaterialsList = new MaterialsList( { all: materialTwo } )
stuObject = new Collada("shape.dae", myMaterialList);
stuObject.addEventListener( InteractiveScene3DEvent.OBJECT_PRESS, onStuPress);
default_scene.addChild(stuObject);
protected function onStuPress(e:InteractiveScene3DEvent):void {
trace("hi");
}
Collada MaterialList Problem (PaperVision3D)
Hi Everyone,
I am trying to apply a material to a Collada model through ActionScript 3.0. I am having little to no success. I am able to change the texture by modifying the dae file directly by giving it the file in the <init_from>texture.jpg</init_from> field, but I need to do it through ActionScript so I can change the color of the model, add shaders, etc. Here is my attempt on getting one solid color material onto my sphere model:
Code:
// LOAD MODEL HERE
colorMaterial1 = new ColorMaterial(0x53F20D);
colorMaterial1.doubleSided = true;
var materialsList:MaterialsList = new MaterialsList();
materialsList.addMaterial( colorMaterial1, "color1" );
testModel = new Collada("checkeredSphere.dae", materialsList, 2.5);
testModel.rotationY = 180;
default_scene.addChild(testModel);
My model displays on the screen at the correct scale, but no material is shown. I just see the basic wireframe which is not even in the color I specified for the material.
See example using the code block above: http://www.scotspellman.com/test/Sphere/TestModel.html
Please help, I do not know what I am missing or doing wrong... I've been trying to resolve this issue for over a week now .
Any help is always greatly appreciated,
Thanks in advance!
PS - Hopefully the code block above is enough to see my problem, if not I am more than happy to send over source files on request. Thanks again.
PV3D - COLLADA - VideoStream Material Issue....
Happy Sunday Everyone,
I'm trying to use a VideoStreamMaterial to replace a Collada Color Material, (imagine a 3D TV set playing a video).
The collada material is referenced as "ERGlossy10" in the Dae file.
I can get the video to play, though can't see the image on the Collada file (can hear audio).
I think I need to reference the VSM material in the DAE file or vice versa ("ERGlossy10"), somehow....
Any Thoughts on how to do this?
_gravityslave
* hacking my way through life, one line of code at a time
AS FILE:
Code:
vsm = new VideoStreamMaterial(video, stream);
//vsm.doublesided = true;
var lMaterialsList:MaterialsList = new MaterialsList();
lMaterialsList.addMaterial ( new ColorMaterial ( 0x343434, 100 ), "Color_00");
lMaterialsList.addMaterial ( new ColorMaterial ( 0x000000, 100 ), "Color_01");
lMaterialsList.addMaterial ( new ColorMaterial ( 0x1B1B1B, 100 ), "Color_02");
lMaterialsList.addMaterial ( new ColorMaterial ( 0xE5E5E5, 100 ), "FrontCol");
lMaterialsList.addMaterial ( new ColorMaterial ( 0xCBCBCB, 100 ), "Color_03");
lMaterialsList.addMaterial ( new ColorMaterial ( 0xB2B2B2, 100 ), "Color_04");
lMaterialsList.addMaterial ( new ColorMaterial ( 0xE5E500, 100 ), "Color_E0");
lMaterialsList.addMaterial ( new ColorMaterial ( 0xE5E5E5, 100 ), "Color_05");
lMaterialsList.addMaterial ( new ColorMaterial ( 0xE50000, 100 ), "Color_A0");
lMaterialsList.addMaterial ( new ColorMaterial ( 0x000000, 100 ), "Foregrou");
lMaterialsList.addMaterial ( vsm, "ERGlossy10"); ///// front material
mCollada = new Collada("TV2.dae", lMaterialsList, 0.01);
DAE FILE:
Code:
<effect id="ERGlossy10-fx">
<profile_COMMON>
<technique sid="common">
<phong>
<ambient>
<color>0 0.4 1 1</color>
</ambient>
<diffuse>
<color>0 0.24 0.6 1</color>
</diffuse>
<specular>
<color>0.68 0.68 0.68 1</color>
</specular>
<shininess>
<float>37.5467</float>
</shininess>
<reflective>
<color>0 0 0 1</color>
</reflective>
<reflectivity>
<float>1</float>
</reflectivity>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_materials>
<material id="Color_00" name="Color_00">
<instance_effect url="#Color_00-fx"/>
</material>
<material id="Color_01" name="Color_01">
<instance_effect url="#Color_01-fx"/>
</material>
<material id="Color_02" name="Color_02">
<instance_effect url="#Color_02-fx"/>
</material>
<material id="FrontCol" name="FrontCol">
<instance_effect url="#FrontCol-fx"/>
</material>
<material id="Color_03" name="Color_03">
<instance_effect url="#Color_03-fx"/>
</material>
<material id="Color_04" name="Color_04">
<instance_effect url="#Color_04-fx"/>
</material>
<material id="Color_E0" name="Color_E0">
<instance_effect url="#Color_E0-fx"/>
</material>
<material id="Color_05" name="Color_05">
<instance_effect url="#Color_05-fx"/>
</material>
<material id="Material" name="Material">
<instance_effect url="#Material-fx"/>
</material>
<material id="Foregrou" name="Foregrou">
<instance_effect url="#Foregrou-fx"/>
</material>
<material id="ERGlossy10" name="ERGlossy10">
<instance_effect url="#ERGlossy10-fx"/>
</material>
</library_materials>
Collada Model Shows On Local Machine, But Fails On Web
Hi Everyone,
I am fairly new to PaperVision3D, so bear with me. I've recently been contracted to display some models in Flash CS3, specifically collada (dae) format models for PaperVision3D. So, our modeler made me a textured sphere in maya and used some plug in to export to collada for me. I can then display the sphere with now problems, I even was able to add mouse / camera interaction, really neat stuff. PaperVision3D is sweet
The Problem: The swf builds fine on my local machine, I can double click either the compiled swf or the published html page and wha-la, works great! Now I upload the html and the associated files to my server and nothing displays... My swf is there, but the model never show up.
My Thoughts:
• Possibly a security issue? Maybe the swf isn't trusted?
• Bad model?
Feel free to download all of the associated files here:
http://www.scotspellman.com/files/CheckeredSphere.zip
Unzip and then Double Click on TestModel.html to see the spheres.
The exact same TestModel.html is being hosted here with all of the associated files:
http://www.scotspellman.com/Spheres/TestModel.html
Notice how none of the spheres display.
Please help! Any help would be greatly appreciated. Even a link to a thread on this subject would be great. I'm stuck
Thanks in advance,
~Scot
Value Inside Object
Hi,
Shortly. I have 3 objects: object1, object2, object3
object1._x shows x cordinates of object1.
How can I show different objects x cordinates, like this
xxx = object1
xxx._x -> should show object1 cordinates and
xxx = object2
xxx._x -> should show object2 cordinates
Thank you for helping.
Problem With: Local Folder Path, With .swf File Inside A .html File
hey i have:
index.html
in the root of the "folder-structure".
and a photoslide.swf file inside
flashfiles/photoslide.swf
other files inside :
flashfiles/
is
flashfiles/pic1.jpg
flashfiles/pic2.jpg
flashfiles/pic3.jpg
now the index file is at root of the file structure and the photoslide.swf file is embedded in the index.html file.
and then the photoslide.swf file loads in the jpg files.
But it doenst work. unless i put the pictures inside the root level of the file structure. And by doing this i lose some of my options. anyway around this? obviously i could jsut set the photoslide.swf file to load files from the path flashfiles/pic1.jpg. But if i do this i must edit every photoslide.swf file in every flashfiles fodle ri have on the server. I have 10.
So my question is as following;
Is there a way to set the photoslide.swf file to always read from the folder the photoslide.swf file is? and not the folder it is embedded in.
thanks from Neptunesnectar
Getting The Object Name Inside The Object
//i have an object...
this.MyObject = function()
{
this.name;
};
//now the instance of that object...
myObj = new MyObject();
//here's the question...
//how do i get the name of the instance ("myObj") to be stored inside the object instance itself in the member varible (name)?
//i've tried making a function that runs a "for(var name in this)" but it sucked.
//once of i have that, i'll be able to list all the objects into an string array and process each one.
//or... is there an entirly different and more efficient approach all together?
//thanks in advance
Weird Issue, Outside Of File Is Messing With The AS Animation Inside The File
The problem is when you click like over on the masthead image to the
left of the swf, it goes really fast! Is that something that can be
caped?
The speed in the file gets set like so:
this._visible = true;
// speed at start
var speed=.5;
// speed by mousemove
if ((_root._ymouse<100) || (500<_root._ymouse)) {
speed = speed*0.9;
} else {
speed = (0-_xmouse)/150;
}
Is there a way to create a maxspeed that the file will not go beyond?
And why could clicking outside the file affect the file?
Thanks for any help!
Brian
This Keyword Inside Object
I'm using this:
imageLoader_listener.onLoadInit = function(target_mc:MovieClip) {
the only way I know how to access variables I set in target_mc is by using the array access like this...
this[target_mc].theVar
but I can't use this inside an object because it refers to the object.
How do I deal with this? Do I have to make a separate function with these statements that gets called for the object?
Thx, a little confused with this, I've run into this a few times any clarification is appreciated.
Fix Object Inside Stage
ActionScript Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "B";
Stage.addListener({onResize:reposition});
function reposition() {
var mc = _root.mainContent_mc;
var newX = Math.floor((Stage.width - mc._width) / 2);
var newY = Math.floor((Stage.height - mc._height) / 2);
mc._x = newX;
mc._y = newY;
};
function reposition() {
var mc = _root.full;
full._width = Stage.width;
full._height = Stage.height;
mc._x = newX;
mc._y = newY;
};
reposition();
I need mainContent_mc to fix to bottom center, and full to fix to screen.
Currently the result is:
mainContent_mc fixes to bottom center, but full hangs off the bottom right edge.
Is there a way to do this?
If I change it to Stage.align = "TL"; it will reverse the problem...
Thanks.
Please HELP: Loadvars Object Inside Loaded Swf
Hi, I have a hard time figuring this out...
I have a main movie that loades a submovie with the loadMovieNum command...
Inside this loaded movie I have some actionscript that loads some data from a text file using the loadvars object and puts it in a text field
now.. if I run the loaded movie bi itself everything works fine... if I run the main movie, the loaded movie seems to be unable to access the loaded data... although the onLoad function gets called and receives true.. just as if the data was loaded correctly...
please note that I am using all relatives paths and stuff.. and that the loaded movie actually sees the local loadvars object fine..
If I set some properties manually, like myLoadVars.test='testing';
the loaded movie accesss those properties just fine and prints them in the text field... but the loaded property is just not there....
I am really clueless.. any hint...?
Thanks so much in advance
Sergio
////Code follows
function get_data_file(zlan)
{
//loads different file depending on language
var datafile;
switch(zlan)
{
case 'it':
datafile="comp/comp_it.txt";
break;
}
zmyLoadVars.load(datafile) ;
}
function settext(ztext)
{
mytext.text=ztext;
}
zmyLoadVars = new LoadVars();
zmyLoadVars.test='testing';
zmyLoadVars.onLoad=function (suc)
{
if(suc)
settext(this.toString());///the test property gets printed but no loaded data
//settext(0);
else
settext('uh uh problem loading file');
}
//mytext.text=_parent.lan;
get_data_file(_parent.lan);
stop();
Repositioning An Object Inside A Mc And Replaying The Same Mc
if i have a movie clip with a tween such as a box moving across a screen, and i also have a button that's suppose to reposition the box and give it a new position. how would i replay that same movie clip with the box beginning at the new position and tween it the same distance? just 1 movie clip though going from frame 1 to 10. this is going to be a loop eventually having the user click on a button and the box moving slowing across the screen and stop until the user click again.
is there anyway of going about it? thanks.
Rotation Of A MovieClip And Object Inside Of It
MC==MovieClip
i have a MC which rotates a whell :
http://www.flashoo.co.il/eitan/wheel_g.swf
in the MC i have bakets that move awith the whell when it rotates.
and to keep the bakets a feeling of a real moving i do :
PHP Code:
wheel.onEnterFrame=function(){
this._rotation+=1;
this.baket1-=1;
}
the thing is if i want to check which of the bakets have reached the top of the wheel i cant!
beaucse if i try to check the _x or _y values of baket1 i recive a value like the baket has never mover from its start position!?!?!?!?
why is that?
how can i check which baket is on hte top?
thnaks i nadvance
peleg
|