Type was not found or was not a compile-time constant: StageWebView - actionscript-3

I am using flash builder 4.0 and am getting the following error. I have tied both 3.5 SDK and 4.0 SDK and set the flash version to 10 or above. I also tried a friends computer with flash builder 4.5 but could not resolve the error either.
Based on the Adobe link below StageWebView is part of AS3 which as I understand should be included with my current project as part of the flash.media.* group but I don't see it when I type the import statement.
Can someone tell me how to add StageWebView to a project or what I am doing wrong?
Error message:
Type was not found or was not a compile-time constant: StageWebView
Related link:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html

StageWebView and many other classes are just for use with Adobe AIR, although they are included in the flash packages. sometimes also object methods are only available to AIR.
you recognize what is available only to AIR by the little red triangle logo in the reference.
Adobe AIR is not available in the web plugin. It is used to create "standalone" applications for desktop and mobile.

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.

AS3 SecureSocket addBinaryChainBuildingCertificate not avaiable?

I want to use the addBinaryChainBuildingCertificate() method of the SecureSocket to setup a connection to a HTTPS/SSL Webservice. But this method is not avaiable inside the flash platform. I got this error:
ReferenceError: Error #1069: Property addBinaryChainBuildingCertificate not found on flash.net.SecureSocket and there is no default value.
So I`m wondering. Is this method only avaiable when using Flash builder and Flex? I have Flash CS5 and Adobe air 3.8 installed.
I read the reference:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SecureSocket.html
They said you can use it, but it is not mentioned in the paragraph: "Public Methods"
you need to compile as an App (i.e. native binary for iOS or Android) not as Flash. Not all methods and classes are available to Flash (i.e. SWF for web)

flash builder 4 : flash.net.SecureSocket can not be found

I have Flash Builder 4 installed. I created a new Actionscript project and when I try to import flash.net.SecureSocket, I get a compile error saying that flash.net.SecureSocket can not be found.
My guess is you're working on a mobile app and there is no support for ServerSocket or Socket for that matter on mobile or for TV see the note in the top of the docs:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SecureSocket.html
That said there is an ANE out there for a Socket class for iOS, I personally plan on eventually writing one for the Android side as well as they also provide a Socket class (I have no idea why Adobe doesn't support this out of the box).

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.