having simple buttons in papervision
there's a simple thing in papervision I can't do , I want to have a sim开发者_如何学JAVAple button on my swf like we have in flash , just a 2d square which is on screen and you can click on it and have some action , I didn't find any solutions for this
I'll be appreciated if someone can help me with this
thanks
First of all, I would like to say that you'd better not use papervision anymore, since that project has been stopped and will not be developed any further. It is better to change to Away3D for that matter.
That being said, I do have the solution to your problem. It is actually very simple. You can just add an OBJECT_PRESS-eventListener to a 3Dobject, or you can create a button that isn't a 3Dobject and justr place it over your view (if you want a 2D-button).
//If you want a 3D-object to act as a button
yourButton.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, someFunction);
//If you want a 2D-non-papervision-button to be over your view.
var yourButton:Button = new Button();
stage.addChildAt(yourButton, IndexHigherThanYourView);
精彩评论