View unanswered posts | View active topics


Reply to topic  [ 4 posts ] 
Code Generation: Auto-Cast 
Author Message
Member

Joined: Mon Oct 11, 2010 7:31 pm
Posts: 5
Post Code Generation: Auto-Cast
Hi,

just another feature request. How about automatic casting?
For example this line:
Code:
var mc:MovieClip = getChildAt(i);

should be converted into this:
Code:
var mc:MovieClip = MovieClip(getChildAt(i));


Best would be to let FD do this automaticalls without having to push a button.
BTW: Can I create my own code generators some way? The snippets are not powerfull enough to my mind..


Sun Nov 14, 2010 5:48 pm
Profile
Member

Joined: Thu Feb 09, 2006 10:58 am
Posts: 943
Location: Israel
Post Re: Code Generation: Auto-Cast
as far as I know, typing:
Code:
var mc:MovieClip = getChildAt(i) as | // will trigger completion with default for movieclip

_________________
MovieClipCommander


Sun Nov 14, 2010 6:38 pm
Profile
Member

Joined: Mon Oct 11, 2010 7:31 pm
Posts: 5
Post Re: Code Generation: Auto-Cast
Thanks, then I'll switch to using "as". Just used it because I heard it was faster but I was wrong obviously: http://jacksondunstan.com/articles/830


Sun Nov 14, 2010 7:45 pm
Profile
Member

Joined: Sun Aug 19, 2007 4:56 pm
Posts: 195
Location: Germany (TEMP)
Post Re: Code Generation: Auto-Cast
You should use both. Depending on what you need.

If you need to change type - you cast it.

If you don't need to change type, just tell compiler that this MovieClip you are getting from Library is MovieClip, us 'as'.



Have fun.


Mon Nov 15, 2010 5:45 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.