What does the message "Test Movie Launch Failed" mean? (Flash Professional CC) - actionscript-3

The Problem
When I was creating a test program using Flash Professional CC, I got the message "Test Movie Launch Failed" while compiling, and when I tried to open it, nothing happened and it didn't open. However, I got no compiler errors whatsoever, it just said "Test Movie Terminated." in the output.
What Might be Going on
I was thinking it might have been an error in my code, but I can't tell since the error message is extremely vague and no runtime errors appear.
So Here's my code (just in case if it's an error of the code)
Info:
Target: Air 3.6 for Desktop
Script: ActionScript 3.0
Objects:
Input Text Box with instance name of "writeT"
Dynamic Text Box with instance name of "readT"
MovieClip with instance name of "Write" (Too lazy to make buttons)
MovieClip with instance name of "Read"
import flash.filesystem.*;
import flash.events.MouseEvent;
Write.addEventListener(MouseEvent.CLICK, writeToFile);
Read.addEventListener(MouseEvent.CLICK, readFile);
var file:File = File.desktopDirectory.resolvePath("stuff.txt");
var fs:FileStream = new FileStream();
function writeToFile(e:MouseEvent):void{
fs.open(file, FileMode.APPEND);
var text:String = writeT.text;
fs.writeUTF(text);
writeT.text = "";
fs.close();
}
function readFile(e:MouseEvent):void{
fs.open(file, FileMode.READ);
var text:String = fs.readUTF();
readT.text = text;
fs.close();
}
EDIT: I commented all of my code and the error still showed up, so ignore the code

I typically see this if I use a library (.swc or .ane) that the desktop debugger cannot use.
If you using any libraries, perhaps uncouple them to see if the error disappears.

Difficult to say what the exact problem could be. From what I read, seems like a version issue. This thread maybe of some help : https://forums.adobe.com/thread/1007928
On a side note, I noticed that you have your instance named as Write and Read. I would typically avoid such names as they might conflict with reserved keywords, and while naming instances, it's best to name them using a camel case convention.
So, I would name them something Iike writeMc and readMc.
Hope this helps.

if you're publishing a mobile app, test on a mobile. you will get that error when using certain mobile-only code in the test environment. ie, test on an appropriate (ios/android) mobile.

Related

Box API .NET SDK: "pad block corrupted" exception when instantiating BoxJWTAuth

I'm using the Box SDK for .NET and just trying to get started authenticating using the Java Web Token workflow. I'm using code that's pretty much the same as the code sample that's included in the SDK's code examples.
var jwtPrivateKey = File.ReadAllText("private_key.pem");
var boxConfig = new BoxConfig(ClientId, ClientSecret, EnterpriseId, jwtPrivateKey, JwtPrivateKeyPassword, JwtPublicKeyId);
var boxJwt = new BoxJWTAuth(boxConfig);
But at that last line I'm getting an exception that says "pad block corrupted". The stack trace seems to indicate that it involves reading the private key, but I don't see what I could be doing wrong considering this is basically the same as the code sample (https://github.com/box/box-windows-sdk-v2/blob/master/Box.V2.Samples.JWTAuth/Program.cs).
Any ideas?
After re-generating the private key with Cygwin, things are working for me.
I believe what happened was I opened the private key in Notepad or something, then saved it in some format it didn't like (maybe changed encoding to UTF-8, or saved it with Windows-style line breaks).

FLASH FDT - What's wrong with this code

Sorry my poor english
I'm a newbie in ActionScript 3.
In FLASH FDT I'm trying to load a xml file using this code:
/* some code */
var questionsURL:URLRequest = new URLRequest('questions.xml');
var loadXML:URLLoader = new URLLoader(questionsURL);
loadXML.addEventListener(Event.COMPLETE, questionsLoaded);
/* more code */
function questionsLoaded(e:Event):void {
var myText:TextField = new TextField();
myText.text = "File loaded!";
addChild(myText);
}
The problem is that the event COMPLETE is never trigged.I never
see the TextField with the text "File loaded!".
The project build successfully with no erros in FDT's Console...
The xml file is in the same folder that generated swf file
I'm using FDT Free.
Thanks for any help.
Thank you for your help.
I find the solution: the problem was related with the security settings of Flash Player.
I only have to add the FDT workspace as a trusted location for developer tests.
Sorry for my poor english.
I believe, it's because your xml file is never loaded, because of wrong path.
Add the error listeners & handlers for them to see the error reason.
loadXML.addEventListener(IOErrorEvent.IO_ERROR, urlLoaderIOErrorHandler );
loadXML.addEventListener(SecurityErrorEvent.SECURITY_ERROR, urlLoaderSecErrorHandler);
...
/* handlers code */
and add some trace output into your questionsLoaded handler for debug purposes

No error description in text property of IOErrorEvent, only error number

I am using in my application a swfLoader and I am listening IOErrorEvent, something like this:
<mx:SWFLoader id="Load" ioError="IOErrorHandler(event)"/>
then I am catching some IO errors and show them as a text in some label:
private function IOErrorHandler(event:IOErrorEvent):void {
label.text = event.text;
}
}
The problem is next: when I run this app on my enviroment, everything is OK. During loading non-existence swf-file I have the next error in label: "Error #2036: load never completed" - and this is the expected behaviour.
But then I run this app on some enviroment without Flash Builder, label text is next: "Error #2036"
And that is all, no description.
Does anybody know why this happens? Maybe I should build my project with some special keys?
This is a difference between the DEBUG version of flash player, and the regular version of flash player.
Likely the reason is to save space on the flash player install (which long ago making flash player as small and quick to install as possible was key) - though I'm guessing as to the why.
You will need to display your own friendly messages if you wish to show that to the end users:
private function IOErrorHandler(event:IOErrorEvent):void {
switch(event.errorID){
case 2036:
label.text = "Load Never Completed";
break;
}
}
If you want a list of errors you can parse pragmatically, someone has made a handy xml file here:
http://divillysausages.com/files/runtimeErrors.xml

AS3 text to file

I'm making a game in cs3 using as3. I've seen dozens of tutorials, but none of them are working for me.
I found the simplest code I could, and it still gives me an error "1061: Call to a possibly undefined method save through a reference with static type flash.net:FileReference."
here's the code I'm using:
var file:FileReference = new FileReference();
file.save("this is a text", "file.txt")
Are you importing FileReference? If not, you'll need:
import flash.net.FileReference;
..inside your package declaration (or at the top of your block of code if you're coding on the time line)
With that import included, your code works for me.

Flex - why are these methods not found on my Date objects?

I am trying to compile some example actionscript code. In Flex (Flash Builder 4.6) I imported a project folder (happens to be the PurePDF examples).
In a few places, I have yellow "?" icons when looking at the source files - though there are no warnings or errors showing up for them yet (I do have other errors I am addressing).
This is an example - when I hover the "?" icon, I see access of undefined property getTime:
end_time = new Date().getTime();
Another one, says undefined property getStackTrace()
catch ( e: Error )
{
trace( e.getStackTrace() );
}
I cleaned up the errors I mentioned, and these yellow "?" marks still appear when viewing the code. There are no warnings or errors in the 'problems' window, but these question marks I describe are still there. Even if I close the file and clean the project and re-open the file.
It seams an issue with Falsh Builder. Anyway to get over it use:
new Date().time
instead of
new Date().getTime()
getTime() is a method of the Date class;
getStackTrace() is a method of the Error class.
Make sure you have imported these two top classes:
import Error
import Date