≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Using 2d overlay items as buttons in actionscript
Posted by:
(you are not logged in)
Enter the missing letter in: "Intern?tional"
(you are not logged in)
Text:
[quote][b]hupie[/b] wrote: Hey, I want to add 2d buttons to my 3d scene and code them in actionscript but i cant get it to work. -When i draw rectangle's on the Flash Stage on a new layer, they show up for a split second when i test the movie and then gets overlayed with the 3d scene immediately after. So i cant add buttons this way. -When i make 2d overlay items in CC editor i have trouble calling them. I tried this code (using the template code found in the docs http://www.ambiera.com/coppercube/doc/index.html ) [code] // called when the coppercube .swf file has been loaded and initialized private function onCoppercubeLoaded(e:Event):void { // get access to the simple API object: coppercubeSprite = loader.content as DisplayObject; simpleAPI = coppercubeSprite['simpleAPI']; stage.addEventListener(KeyboardEvent.KEY_DOWN, aKeyDown); addEventListener(Event.ENTER_FRAME,frameLoop); // code below doesnt work var button:Object = simpleAPI.getSceneNodeByName("button"); button.addEventListener(MouseEvent.CLICK, ); }[/code] But then i get this error [code]TypeError: Error 1009: Cannot access a property or method of a null object reference. at main/onCoppercubeLoaded() [/code] So how do i get working 2d buttons?[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact