My Books

  • Follow me on Twitter
My Photo

Subscribe my blog

  • Get this widget from Widgetbox
  • Add to Google
  • RSS FEEDS
  • Enter your Email here to subscribe :



    Powered by FeedBlitz

Blog Widget by LinkWithin

« Want to join the beta of the next Flash Media Server 4 ? | Main | Heading to The ActionScript Conference in singapore »

Comments

Peter

That's a very useful tip, thanks Marco! I suppose we'll be able to do something similar to this approach in Gumbo using Vectors if targeting Flash Player 10, which essentially are mono-typed arrays?

Cyril Hanquez

Really nice ! Again something I didn't know... :-)

Gareth Arch

Is there something special that needs to be add to the compiler arguments? I just tried setting an incompatible VO to my array, and no error was thrown in compile-time nor run-time. I, at first, set it inside an AS object (such as a TestVO) with a property that was an array (typed to TestUser). I tried pushing a different object into the array (something other than TestUser) and no error was thrown. I also tried setting a typed array in my main application file and pushing a non-TestUser object into it, but it still allowed it (with no error thrown). Is there something else I need to do to get this to work properly?
Thanks.

Marco Casario

Gareth,
Are you using MXML compiler right ?
Otherwise no errors will be thrown.
Best

Mário Júnior

Just, remembering wich meta-tag made tha compare type in compile time. In runtime, not compares the object type has been inserted.

This feature is usefull for who build custom components.

In the Flash Player 10, we have the Vector for simulate the Generics Java/.Net concept. In this case, is able use: protected var _users:Vector;

Regards.

Ricardo Poblete

I have no error was thrown in compile-time, i tried on FLex2 and Flex3. This is my code.

import VO.UserVO;
ArrayElementType("UserVO")] protected var _users:Array = new Array();

private function load():void{
_users.push( new UserVO ('1', 'ripoblet', 'role', 'description' ) );
_users.push(1,2,3,4);
}

Maybe i need some arguments.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment