There might be other problems I have forgotten about (I made the switch
a long time ago) - do you have any specific examples of problem areas?
(You should at least be getting line numbers during errors with "permit
debugging" checked - that's a huge help).
If you've already gone down the path of defining all your stage elements
as properties, you'll also have to undo all that.
Another big thing is how to reach into a child-clip's properties - which
the compiler won't let you do with children that aren't dynamic - unless
you cast to that object's specific class, or a dynamic class (like
MovieClip). So for the short term, it's probably easier to stick with
MovieClip, or a custom Sprite derived class marked with dynamic, until
you really get used to static typing and casting.
On the opposite side, there's getting access to parent clip's props and
methods. The other coders on the list may wag their fingers at me for
this - but this is how you can do it:
// in some child clip that you want to access the parent's public
functions and properties
(parent as MovieClip).method();
// or
var _parent:* = parent; // I think this works..
_parent.method();
The problem with doing things this way, is you can get some pretty
cryptic error messages (but that was true in AS2 as well).
I think (I can't remember how AS2 works, it's been a while), you have to
change properties to be more explicit in AS3 - so if you want them to be
properties they have to be preceded with `this.` in AS3, so:
// to make this accessible to parent or children
this.method = function(){}
// instead of
var method = function(){}
// or
function method(){}
// if you already have local references that don't use `this.`, you can
do both
this.method = function method(){}
// or
var method = this.method = function(){} // or some value
I actually really recommend starting from scratch on some project with
AS3, rather than converting an older fla. When I did that, is when I
started to figure out how AS3 stuff works.
Oh, another thing is targeting Flash 9 is buggy (the MovieClip object
doesn't work right). Adobe fixed it all in flash 10 though. That was the
other real big headache.
Kevin N.
The FLA problem only seems to show itself when you convert an older AS2
fla from Flash 8 or lower to AS3. If you start with an AS2 fla from
Flash Pro CS3 (or whichever was the first with AS3) or newer it doesn't
do that.
On 10/24/12 6:43 PM, Karl DeSaulniers wrote:
That didn't fix my problem. :(
I got all excited too.. lol
Karl
On Oct 24, 2012, at 5:38 PM, Karl DeSaulniers wrote:
I did start with a AS2 FLA and switched to AS3.
So your saying the IDE does not add the appropriate stuff when you
just convert?????
WTF! Good to know Kevin.
Thanks
Best,
Karl
On Oct 24, 2012, at 4:25 PM, Kevin Newman wrote:
When I first started in AS3, there were two blocks that caught me up
a lot. I started from an older AS2 FLA and then converted to AS3 -
that was the cause of the problem.
If you do that, you end up with an AS3 fla that doesn't have the
right settings in the AS3 Properties panel. You won't have
automatically declare stage instance set, or strict mode (you want
both).
Also, to get actual line numbers with errors, you'll need to check
"allow debugging" in publish settings - I know it sounds like it's a
permissions thing, but it really enables debugging symbols to be
embedded in the swf, so that when you get an error, you'll actually
get a useful error number with it.
Good luck!
Kevin N.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders