THE ISSUE: Ah lovely "ReferenceError: Error #1065: Variable addFrameScript is not defined." can you be more vaque?

THE FIX: in whatever the piece of code in the stack trace, inside the Fla, navigate internal to the frame, and remove any script OR comment on the timeline.

WHY:Somewhere in the initialization the script on the timeline and whatever script that is associated with the MovieClip is colliding.

Found this FlashKit post though tangential to the Error #1065 gave me the clue to solving , thanks cancerinform!


{ 0 comments }

NEATO! Did you know that stack trace (getStackTrace ) can be used even when NOT throwing an Error to get more actionscript debugging information when you need it (and only when you need it).  WITHOUT throwing Errors interrupting program flow and WITHOUT using the sluggish remote debugger.

Plus it's very easy to do. Let's look at example.

	if(LID == 0 && n == null && breakCount++ >=0) { //some complicated break condition
				var er:Error =new Error("BREAK"); //creating but not throwing the error
				trace(er.getStackTrace()); // see where the issue is happening, but continue running normally!
 
			}

In that example we created some conditional checking, created a new Error but only traced the getStackTrace to the Trace console, instead of the normal throwing of the Error to get it.

Why is getStackTrace + Trace approach useful?

Say you are working on a game where a tricky to find bug is happening way into the game at 24fps. You have a general idea of where the error is happening, and that code that is called in multiple times from multiple places, in some cases this works perfectly others are related to a bug you are trying to track down.

There are two tips there: one is to create temporary conditional check once you know the general ball park of the bug. This is useful as breakpoints often don't have the smarts to know one normal condition from an error condition, forcing you spend a lot of time either going from break point to breakpoint or digging through the debugger.

Using the remote debugger isn't always easy or efficient when running say game+physics simulations in the a swf running elsewhere.

So by doing this you get a large stack track, with the exact line numbers on the files, making it much easier to figure out where in the call stack the error is happening evolves.


EXAMPLE OUTPUT:
Error: MY BREAK
at com.someproject.views.model::CharacteModel/setCharacterUI()[C:\src\flash\com\someproject\views\model\CharacteModel.as:381]
at com.someproject.views::CharacterUI/set curCharacterUIModel()[C:\src\flash\com\someproject\views\CharacterUI.as:386]
at com.someproject.views::MainUI/updateView()[C:\src\flash\com\someproject\views\MainUI.as:1399]
at com.someproject.views::MainUI/set currentPerspective()[C:\src\flash\com\someproject\views\MainUI.as:1243]
at com.someproject.views::MainUI/gotoScene()[C:\src\flash\com\someproject\views\MainUI.as:1214]
at com.someproject.views::MainUI/callIN_FromJS()[C:\src\flash\com\someproject\views\MainUI.as:229]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at com.troyworks.events::EventAdapter/callFunction()[C:\DATA_SYNC\CodeProjects\workspace\TroyWorksAS3\dev\src\com\troyworks\events\EventAdapter.as:128]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at flash.external::ExternalInterface$/_callIn()
at ()

NOTE this only works in the  flash debug player with you content set to debugging enabled.

I'm not the first to find this

http://weirdcalculator.blogspot.com/2009/04/as3-use-getstacktrace-for-debugging.html

This ultrashock post on getting line numbers has a utility wrapper class to help with this as well as pretty print objects/arrays

{ 1 comment }

FlashBug, Firebug extended for Flash!

March 8, 2010

Neato! If you understood the title then you should know enough to check this out.
http://blog.coursevector.com/flashbug/
I still lurv me some SOS Max, in fact I have 1 entire of my 4 1920×1200 monitors typically devoted to it.    Both tools have strong points, seems like an oranges to tangerine comparison.
Why choose when you can have [...]

Read the full article →

How to Create SWC Actionscript Libraries

March 4, 2010

SWC’s are semi mysterious and powerful. Today I’ll show why they are important, how they can make your life easier, and a how to make them for actionscript libraries.
What’s a SWC?
SWC’s are like SWF’s in that that incorporate all your compiled ActionScript, CSS, assets. They are alot like a zip or rar to [...]

Read the full article →

KooshTool KooshBalls Generator in AS3

February 14, 2010

Kooshes in Space! Well not quite.
(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)
TO USE: 1) click to generate balls, 2) drag farther away from the click to make the spray farther out.
Spent an hour, created a AS3 port [...]

Read the full article →

Free AS3 and FDT Training at the RMI..but only til end of Feb

February 5, 2010

If your serious about learning AS3, this is a great deal.
Free through February 28th
Introduction to ActionScript Development with FDT
30 minute introduction to the world’s most powerful ActionScript editor with Alan Klement. FDT is the tool I personally use for the majority of my projects. They just released a new version that make it [...]

Read the full article →

SOLUTION SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller + CDN + AMAZAON S3 + SWFObject

January 22, 2010

If you have your assets on Amazon S3 and are using SWFObject you might run into SecurityError: Error #2060:
This is two parts, one you need to get your
allowscriptaccess = “always” since if your serving the html from http://www.yoursite.com and the assets are coming from a different domain e.g. http://yourcdn.amazons3.com you need to allow them to [...]

Read the full article →

Flash ReferenceError: Error #1069: SOLUTION

January 6, 2010

This means that you have a typo someplace, it’s basically the equivalent of a web 404 error on your code, even if the code may be potentially valid from the scripting environments perspective.
BAD CODE:
object[someproperty];
GOOD CODE
object(someproperty); like in getterFunction(someproperty);
In our case this happened when changing direct access to a associative array into a [...]

Read the full article →

Setup and Develop multi-touch Flash and AIR on the Dell XT2 with N-trig drivers

January 4, 2010

You know you’ve been drooling to playing with multi-touch apps at home, now you can with commodity hardware.
In this post we’ll cover 3 things

how to get multi-touch properly setup on the gorgeous Dell XT2 Tablet PC
play with some multitouch apps written in Adobe AIR Runtime 2.0
get your Flash or Flex setup to start [...]

Read the full article →

Javascript: form submit is not a function SOLUTION

October 17, 2009

Working on some rich form in Flash  that integrates in with Aweber via ExternalInterface and javascript, what’s odd is worked fine, after updating, ran into that odd error, alerting showed that I was talking to the form, but calling submit function failed.
Solution was to rename the submit button in that form to submit2 as [...]

Read the full article →