flash - ActionScript Library Project vs. Flex Library Project -


i've got couple of issues nature of inconsistency between flexlib project , as3 lib project in flash builder 4.7, air sdk 15, 16 , 17, flex sdk 4.6.

common thing these flexlib not allow (syntax error highlighted) build/compile pieces of code allowed in regular as3lib project.

please note examples bellow simplified, , there real life use cases if it's against practices.

internal classes above package

internal class before  {     public function before(){} } package {     public class main     {         public function main()         {         }     } } 

in flex library project code causes:

1083: syntax error: package unexpected.

in regular actionscript library project works fine, without single warning.

array key type greediness

var array:array = [boolean, number, xml]; for(var c:class in array) {     if(c object) { trace('test') } } 

in flex library project code causes:

1067: implicit coercion of value of type string unrelated type class.

in regular actionscript library project works fine, without single warning.

constant defined class

public static const fileclass:class = string; public function main():void {     if('test' vector.<fileclass>)     {         trace('what?');     } } 

in flex library project code causes:

1120: access of undefined property fileclass.

in regular actionscript library project works fine, without single warning.

i'd thankful if word why happening or give me clue solution.

according this, there 2 different compilers involved:

use legacy compiler actionscript projects, flash builder uses actionscript compiler (asc) default. if using adobe flex sdk 4.6 or earlier version of flex sdk, select use legacy compiler use older compiler.

i guess explains difference.


the following attempt work around problem.

i'm not library projects. found in resources (the link above), these projects result in .swc file. i'm not flex either. flex "just" framework written in actionscript.

whether library actionscript library or flex library not choice of user, code does.

if library includes flex components, i'd it's flex library project. if plain old actionscript, actionscript library.

let's library actionscript library. compile library .swc file , done it.

your 1 doing compilation step, not user of library. don't think it's concern if perform compilation. concerns them whether project includes library (the .swc file) compiles. , guess case, because .swc used, not compiled.

after all, there's no choice made, if actionscript library, because every flex project actionscript project. (but every actionscript project flex project)

build library project (whatever compiler works) , see if can use resulting .swc file in both actionscript , flex project.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -