Codecompletion in FD

Software: Away3D 4.x

jewtis, Newbie
Posted: 30 October 2011 08:39 PM   Total Posts: 3

Hi!
I`m trying to get into the new Away3D. Since I`ve moved from 3.6 to 4.0 I`m missing some codecompletions. I`m using FD 4.0, playerglobal11.

If i like to add an Eventlistener to an object, the codecompletion only offers:
item.addEventListener(Event.activate
                  or Event.deactivate

In spite of that, I’m able to type in the Eventclass, then type DOT .
Afer the dot is typed in, the codecompletion works as ever…

Is there something to adjust to get the codecompletion run as ever?

Greetz
jewtis

 

 

   

Avatar
doneykoo, Newbie
Posted: 01 November 2011 09:13 AM   Total Posts: 1   [ # 1 ]

A way I know about is to add Embed [Event] Declarations in the Class (forgive me that I don’t what such code is called officially).

An example:
For Loader3D (away3d.loaders.Loader3D),
if you want to let FD show code-completion options when adding event listener to an object of Loader3D,
add some code into the Loader3D class like this:

public class Loader3D extends ObjectContainer3D
{
  [Event(name = “resourceComplete”, type = “away3d.events.LoaderEvent”)]
  public static const RESOURCE_COMPLETE:String = “resourceComplete”;
  [Event(name = “loadError”, type = “away3d.events.LoaderEvent”)]
  public static const LOAD_ERROR:String = “loadError”;

  // more relative event types ...

after that, the code-completion will work for objects of that class.

   

John Brookes, Moderator
Posted: 01 November 2011 10:47 AM   Total Posts: 732   [ # 2 ]

To add on to this.

In ObjectContainer3D you have
[Event(name=“mouseDown”,type=“away3d.events.MouseEvent3D”)]

Shouldnt that be
[Event(name=“mouseDown3d”,type=“away3d.events.MouseEvent3D”)]

to match with the MouseEvent3D class.

Also not all mouse events are listed in objectConatainer3D

eg

/// @eventType away3d.events.MouseEvent3D.MOUSE_OVER
[Event(name "mouseOver3d"type "away3d.events.MouseEvent3D")

/// @eventType away3d.events.MouseEvent3D.MOUSE_OUT
[Event(name "mouseOut3d"type "away3d.events.MouseEvent3D")

/// @eventType away3d.events.MouseEvent3D.MOUSE_UP
[Event(name "mouseUp3d"type "away3d.events.MouseEvent3D")

/// @eventType away3d.events.MouseEvent3D.MOUSE_DOWN
[Event(name "mouseDown3d"type "away3d.events.MouseEvent3D")

/// @eventType away3d.events.MouseEvent3D.MOUSE_MOVE
[Event(name "mouseMove3d"type "away3d.events.MouseEvent3D")

/// @eventType away3d.events.MouseEvent3D.CLICK
[Event(name "click3d"type "away3d.events.MouseEvent3D")

/// @eventType away3d.events.MouseEvent3D.DOUBLE_CLICK
[Event(name "doubleClick3d"type "away3d.events.MouseEvent3D")

/// @eventType away3d.events.MouseEvent3D.MOUSE_WHEEL
[Event(name "mouseWheel3d"type "away3d.events.MouseEvent3D")

Ill stick an issue on Git

   

Avatar
TheSillyOne, Newbie
Posted: 02 November 2011 12:15 PM   Total Posts: 28   [ # 3 ]

Works for me with FD 4.0 RC1 and the current git source.

Best regards.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X