Archive for the ‘ActionScript 2.0’ Category

Adobe Flash Player Security

Thursday, June 12th, 2008

Ever got the following error and never found out how to solve it? Here’s the solution.

Error:

Adobe Flash player has stopped a potentially unsafe operation.
The following local application ….
C:\somewhere\file.swf
is try to communicate with…
somedomain.com
To let this app…

Solution:
Create a file with the extension .cfg in the <user>/macromedia/Flash_Player/#Security/FlashPlayerTrust folder (under windows XP this will be: C:\Documents and Settings\_username_\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust) and create two lines in it using a regular text editor.

C:\somewhere\
http://somedomain.com

Save the file and rerun your application.

Error checking

Friday, January 18th, 2008

I ran into the really nice problem of not being able to use Flash’s build in classes today.

Two things to check when you get an error like “The class or interface ‘flash.display.BitmapData’ could not be loaded.”

  1. Flash player settings in the publish settings
  2. The class paths

Turns out I had the player settings wrong. Pretty easy to overlook and it gives you a lot of aggravation.

loading an animation

Friday, June 1st, 2007

For some reason animations will start playing when an X number of bytes is loaded, using the default load methods.

Now for some other reason this is ’solved’ by having a completely blank first frame (nothing on any of your layers). Weird, but my solution for now…

getURL()

Friday, May 11th, 2007

Note to self: getURL() won’t work when testing locally… :(

The class or interface ‘yourClass’ could not be loaded.

Friday, April 27th, 2007

This happens when you try to acces an external class on a frame that doesn't have the import statement for the class. ie:

Actionscript:
  1. // On frame 1:
  2. import yourClass;
  3.  
  4. //On frame 5:
  5. var something:yourClass = new yourClass();

The solution is to put the import statement (also) on frame 5.

XML and Latin-1 characters

Thursday, April 12th, 2007

You should use the decimal character references for these characters to use them in your XML. So instead of writing รก, you should write '& # 2 2 5 ;' (remove the spaces). This way Flash will display the characters correctly.
A list of the char references can be found at: http://www.bbsinc.com/iso8859.html

EDIT: Another way of solving this is setting the XML encoding to UTF-8.

XML:
  1. &lt;?xml version="1.0" encoding="utf-8"?&gt;

Bye bye buttons

Friday, February 16th, 2007

I knew code dedicated to button functionality doesn't work when the button instance isn't on the timeline at the same time (or before) the AS, what I didn't know is this. When you jump forward and back on your timeline and your button instances aren't on the timeline anymore, you loose your functionality as well... :S

"Solution": Hiding your buttons with AS instead of keyframing them.

DHTML

Tuesday, November 28th, 2006

The simplest of things can be so much fun.

Like changing the background color of a website when you change pages in a flash document. How you do this is quite simple. You just call a pice of JavaScript from Flash, like this:

Actionscript:
  1. getURL("js:method(params)", "_self");

An example of this: http://vwg.net/test/su/

note: replace "js" above with "javascript", somehow wordpress isn't happy with me using that word... ;)

Class name conflict

Wednesday, November 8th, 2006

Familiar with this error?

The name of this class, 'b', conflicts with the name of another class that was loaded, 'b'.

This can happen when you're working with files on a server. If the server time is ahead of your computer's time Flash (at least MX 2004) doesn't want to compile them.

The solution is simple: either adjust your server's or computer's time (and date).

Time To Live

Sunday, October 22nd, 2006

Toyed around a bit working on a TTL class as discussed in my thread on ActionScript.org. It's getting there and I'll make the final classes avaible as soon as they're documented and completely working.