Include MX library to Flash CS5 project - actionscript-3

I need to use some classes belong to mx library, but when I try to import it Flash throws me an error that it can't find this library.
How can I import it to my project? I'm using Adobe Flash Professional CS5.

You may try downloading the Flex SDK, get mx.swc from Flex\frameworks\lib and add it to your library path (ActionScript Settings > Library Path) in Flash CS5.

Related

Flash CC on OS X: Where is the ActionScript 3.0 library?

For the life of me, I can't find the AS3 lib. I know in Flash CS6, I can find it at:
/Applications/Adobe Flash CS6/Common/Configuration/ActionScript 3.0/libs
I need to point my IDE at it, and the company I'm at can ONLY use Flash CC going forward (Corporate reasoning), and I'm the first one on the team to have to use Flash CC. My workaround is to use a trial version of CS6, but I'd like to figure this out.
Flash CC supports AS3, so the library has to be somewhere, right? If not, how does it function without it?
Thanks!
It's inside the app package:
/Applications/Adobe Flash CC 2015/Adobe Flash CC 2015.app/Contents/Common/Configuration/ActionScript 3.0/libs
To navigate to this folder, right click on the Adobe Flash CC 2015.app and choose "Show Package Contents".

Is it possible to add Native Extensions to Actionscript Library projects?

I've got an ActionScript Library project which is shared between an ActionScript and an ActionScript Mobile project. It works nicely for sharing everything I need in the two projects, but I'd now like to share an Adobe Native Extension between the two projects.
There's a 'Native Extensions' tab for adding them on the [ActionScript Build Path] screen in both the AS and AS Mobile projects, but not the ActionScript Library project.
I tried adding the ANE via the 'Add SWC' dialog on the [Build Path] screen in the Library project (there is a filter for *.ane on the file browser), but the project then failed to run with a VerifyError: Error #1014: Class myANE could not be found.
Does anyone know if it is possible to add ANEs to ActionScript Library projects, or can they only be added directly to ActionScript or ActionScript Mobile projects?
Many thanks in advance for any advice.
Not in Flash Builder, no. You can do it in IntelliJ (I am in the middle of trying to make the switch right now and that has been a fantastic feature so far). If your ANE is open source, as quite a few are, it is likely the SWC used by the dev to compile the ANE is included in the source code, or you could generate yourself. The SWC is the only portion of the ANE required to compile any kind of AIR app or library. You'll have runtime errors if you don't include the ANE in the app, but that is a given regardless.
So if you have the SWC or can compile one, add that as an external library to your project.

I need to import something in order to use JSON in AS3?

When using the following codeline:
var myjson:Object = JSON.parse("path_to_my.json");
I got the following error:
1120: Access of undefined property JSON.
I had to import any package in order to use the JSON.parse?
Thank you!
[with: Flash CS5 (11.0.0.485), AS3]
JSON is built in to the ActionScript default package starting at Flash Player 11, and is notably higher performance than 3rd party serializers.
With Flash CS5, you need to update the target Flash Player from the Publish Settings. By default it will target up to Flash Player 10.2.
Adobe has a blog regarding Adding Flash Player 11 support to Flash Pro CS5 and CS5.5.
At that page you will find an extension (MXP) install as well as manual instruction of updating Flash Player to 11.
Load CS5 or CS.5 MXP with Adobe Extension Manager, and you will be able to target Flash Player 11.0 from your Publish Settings:
Note that JSON parse takes an object, and not a path to a file.  Your code should give Error #1132: Invalid JSON parse input.

Includeing fl.motion.Color

I was reading this post: In as3 adjusting brightness of the shape is not working via coding, and it says to import "fl.motion.Color," but it doesn't seem to be in the default library. How do I include it?
You have to include the fl library.
You can find it in your installation folder under:
\Adobe\Adobe Flash CS5\en\Configuration\ActionScript 3.0\Classes
You would need to have Adobe Flash CS5 (or other version) installed.

Admob & ActionScript 3

I saw that Admob just released an SDK for Flash Lite (Action Script 2). I'm working on an AS3
project, and could not find anywhere on the internet an AS3 version of the SDK.
Does anyone have any knowledge of such an SDK for AS3 or using the AS2 SDK in AS3.
Thanks
Can
There is no as3 sdk. Also the as2 sdk does not work in as3. It needs to be rewritten in as3. I am not very talented with as3. Can someone rewrite the AdMobAd.as class to as3?
You could try to use the AS2 SDK in an AS2 file that has some methods exposed or reads some URL variables and then try to load that AS2 SWF file into an AS3 container. More info on loading AS2 files in AS3 containers can be found here:
Load AS2 SWF Into AS3 SWF and pass vars in URL
and here:
http://www.kirupa.com/forum/showpost.php?p=1964550&postcount=249
It's a total pain, but it beats having to write the SDK all over again in AS3.
You can check my test flash application for android. I use the StageWebView with html to load the admob. What u need to do is hosting your html page which embeds the admob ads on your web host, then load the html page in your application by StageWebView.