Archive for bugfix

problem: flash stops on ajax call

Problem: you call a javascript method which returns some data (via ajax – php etc..) and flash animation stops / looks ugly.

Solution: do the same thing via a callback method. so js – calls pushes the data to flash.

Why: – when flash calls js functions – flash stops – until it gets the return value. when you use callbacks js calculates stuff and calls flash when the date is already calculated -> no latency / flash stopping.

Flashplayer error #1009 on stageResize

I spotted a strange fp behaviour. On some computers Flashplayer throws an error saying #1009 null object reference.

The Problem: the stage resize is called when the flash app isn’t completly loaded.

The Fix : check for null object:

“if(_videoPlayer != null)”

thanks to martin vor the tip

The as3 loggger i use

http://www.monsterdebugger.com/

Why?

  • works when flash is embeded in html
  • easy to implemnt and use
  • live property editing
  • free
  • works with air technology

contras:

  • the trace time isn’t precise enough
  • slows the swf performance by intens use

conclusion:

This is agreat tool and i can only recommend it.

Flash flv metadata error #1069

Working with flvs I got that error

“Error #1069 onMetaData for flash.net.NetStream not found”

Here’s the fix.

var nc : NetConnection = new NetConnection();
nc.connect(null);
var ns : NetStream = new NetStream(nc);
var vid : Video = new Video();
 
var listener : Object = new Object();
 
// this is optional
//
listener.onMetaData = function(infoObject : Object):void
{
	trace("onMetaData");
	var key : String;
	for (key in infoObject)
	{
		trace(key + ": " + infoObject[key]);
	}
}
 
// this is optional
//
listener.onCuePoint = function(infoObject : Object):void
{
	trace("onCuePoint");
	var key : String;
	for (key in infoObject)
	{
		trace(key + ": " + infoObject[key]);
	}
}
 
// this is "the magic"
//
ns.client = listener;
ns.play("videos/vid2.flv");
vid.attachNetStream(ns);
addChild(vid);

So long

AS3 security error local file system + ant

use this compile property to load local files in your swf.

-use-network=false

Note: If you work on a local webserver you won’t have that problem

Problem with Andy’s ShadowCaster Class?

There seems to be a problem with the ShadowCaster Class created by Andy (my demoimplementation). Well I couldn’t recreate that bug but when you have this error:

“Error #1009: Cannot access a property or method of a null object reference.at ShadowCaster/projectVertex()”

this fix found here might help you out:

private var _type:String = "point";
//...
 
..//
public static var DIRECTIONAL:String = "dir";
public static var SPOTLIGHT:String = "spot";
 
// replaced it with:
private var _type:String = "dir"; // or "spot"

I can’t tell if this is a “good” or “bad” fix because I didn’t really test it.

Original post of the fix is here