Archive

Archive for the ‘Flash’ Category

ArgumentError: Error #2082: Connect failed because the object is already connected.

December 1, 2009 1 comment

Using Flash localconnection i encountered a weird bug today while working on a project connecting AS2 and AS2 SWFs.  Below is the error which i got while trying to connect to a localConnection channel.

ArgumentError: Error #2082: Connect failed because the object is already connected.
at flash.net::LocalConnection/connect()
at com.gskinner.utils::SWFBridgeAS3/connect()
at com.orbis.bridges::TopbarBridgeAS3/connectBridge()
at com.orbis.ui.topbar::FauxF8TopBar/connectBridge()
at com.orbis.game::GameLaunchEntry/allAssetsLoaded()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.orbis.load::Preloader/somethingLoaded()
at com.orbis.load::LoadContent/thisLoaded()

I forcefully quit the Flash IDE while flash player crashed due to loading of huge amount of data via XML for testing certain scenario in the game. That was the cause of the problem, there seems to be some player instance still on.  To more clearer, i was using Flash IDE  not a browser. Finally of no choice i have to restart the system and try to get this sorted out.

After that it works fine. Weird one.. just eat up few mins of my morning time.  So to get clear detail about the bug, google to get few informations. You can find the informations on Judah’s blog and some more information here

Advertisements
Categories: Flash, localconnection

Tween Class

November 16, 2009 Leave a comment

Today while working on AS3 project which uses Tween, encountered a weired issue which causes the Tween to Freeze. This could be a pretty old issue, anyways here were the issue that i encountered and also possible ways of resolving that.

The code that causing the issue was due to the Tween was stored in a local variable and the variable might be garbage collected before the completion of the scripted motion.

Tween Code which may cause Freeze (Buggy)

function someFunction()
{
var myTween:Tween= new Tween(myObject, “x”, Elastic.easeOut, 0, 300, 3, true);
myTween.addEventListener(TweenEvent.MOTION_FINISH, listenerFunction);
// …
}

To prevent the tween code that causes Freeze , Here were few steps that we can do

1. Storing the tween variable globally.

Even if there is an event listener registered for an object, the object may be garbage collected if it’s a local variable ( with the scope of a function). To prevent this, declare the variable globally as in the following.

var myTween:Tween;

function someFunction()
{
myTween = new Tween(myObject, “x”, Elastic.easeOut, 0, 300, 3, true);
myTween.addEventListener(TweenEvent.MOTION_FINISH, listenerFunction);
// …
}

(Took this from Flash documentation, it is weird the way Flash Performs Garbage collection L or I am missing something here?)

2.Using Tween to Keep Reference in the memory until the tween motion is completed, This can be achieved by using Dictionary class or using a custom class to manage the way tween is garbage collected.

Reference links

# Documentation

# Adobe bug base

Categories: Tween

Flash Innovation Timeline

November 10, 2009 Leave a comment

Just got to see a exciting screenshot which helps to know when things got introduced in flash. Thought of having this pic in my blog so that i dont miss that. 🙂

FlashInnovationTimeline

Img taken from Blog

Categories: Flash