flash builder 4 : flash.net.SecureSocket can not be found - actionscript-3

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).

Related

MissingManifestResourceException on Windows Phone 8.1 with .resx resources

I'm developing a Windows Phone 8.1 app that also targets Android(Xamarin)
As ever I added my string resources(.resx) on a PCL and referenced them on my launcher project to use it on my views, this all works fine on WP 8.1 silverlight but on the WinRt when I configure the project to release and run it on a device, for some reason I always get a MissingManifestResourceException. I've tried every solution for this problem out there without any success.
Note that on the emulator everything works fine, when the solution configurator is set to Debug it also works on both device and emulator. The only combination here is device and Release.
The app source code is on Github.
I was able to create a simple project to replicate this issue, basically it is a WP 8.1 app and a PCL project with the embedded resources, Download Link
Anyone has any ideas?
EDIT: After making some more testing I tried running an old Windows 8.1 app that I've done with the same localisation model and the same issue appeared so it seams to be a tool issue and not a configuration issue, since the Windows 8.1 app is on the market and everything went fine back there.
Our team ran into a similar issue which was tracked down to the runtime and not the PCL, WinRT component, or application package. That is, the resources exist within the PCL assembly, within the application package resources.pri file, but just cannot be found at runtime.
There is an active Microsoft Connect report here:
https://connect.microsoft.com/VisualStudio/feedback/details/991028/issue-using-resx-files-on-winrt-apps-windows-phone-and-windows
Our workaround was for the WinRT component to inject into each generated Resources class of each referenced PCL our own derived ResourceManager which redirected the call to the WinRT ResourceLoader instead. I've written a blog post that describes that workaround:
http://blogs.msdn.com/b/philliphoff/archive/2014/11/19/missingmanifestresourceexception-when-using-portable-class-libraries-in-winrt.aspx
I got to the bottom of this today. While bundling the app package, resources in dependencies that are not for a language being used by the app are stripped out. To prevent this from happening, add the following assembly-level attribute to your application.
using System.Resources;
[assembly: NeutralResourcesLanguage("en")]
I had the same behaviour. Today I created a new PCL Library (with another name) and copied the resx file to this project. I modified all references and everything just works fine in my WinRt (Windows Store) App now!
There was the string 'resources' in the portable class library name. Perhaps this was the problem!
I am able to reproduce this issue launching DVD sample and unfortunately in my project. I have an WP Silverlight 8.1 project registering a Windows Runtime Component Background Task and both of them using a Portable Class Library sharing some common localized strings as resources (.resx), among other things. The exception is thrown from Background Task when calling any property to get strings on generated .Design.cs class (only Release + Device).
In order to fix this I tried, without success, to use directly ResourceManager and/or to add .resx files directly into the Background Task.
I ended-up porting needed strings to .resw files and use the new "WinRT preferred" way via Windows.ApplicationModel.Resources.ResourceLoader in the Background Task project.
Seems to me that ResourceManager is not compatible with Windows Runtime anymore in release.
This is not necessary an answer, but is better than nothing since I do not have 50 reputation points for a comment.

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

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.

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.6 - native application issues -

I'm trying to follow a tutorial here:
http://www.as3nui.com/airkinect-2-0-is-here/
which deals with developing an AirKinect application in Flash Builder 4.6, which I've installed. But when I follow the steps, a bunch of menu commands that the tutorial accesses are not available to me. I'm developing an Actionscript project. When I go to the project properties, and click the actionscript build path from the left, in the video there are 3 tabs - source path tab, library tab, and native extensions tab, but I don't see native extensions tab. Furthermore, on the left, he has a menu called Actionscript build packaging - I do not have this. Lastly, he uses a command stage.nativeWindow.visible = false - when I use that it says it is an undefined property. I think that all of these issues have to do some how with the matter of native applications in flash builder, but I'm not sure. Anyone know what's going on?
You've probably started your project with the wrong settings. When you create a new ActionScript Project in Flash Builder 4.6, you can choose how it will run: in a browser or using AIR:
You should select the button "Desktop (runs in Adobe AIR)" under 'Application Type'. Then you will also see that native extensions tab in your project properties.
I don't know how to change an existing project into an AIR Desktop project but it should not be too difficult to create a new one and move your existing code into it.