Flex User

May 17, 2008

adding and removing Enterframe handler on runtime

Filed under: Flex — Tags: , , — nsdevaraj @ 8:56 am

on initialize call :addEnterFrameCatcher()

removeEnterFrameCatcher() to stop enterframe actions on runtime

relistenEnterFrameCatcher() to resume enterframe actions on runtime

 

private var enterFrameCatcher:MovieClip;
private function enterFrameHandler(param1:Event) : void
{
// enterframe script
}
private function addEnterFrameCatcher(): void
{
    enterFrameCatcher = new MovieClip();
    if (enterFrameCatcher)
    {
       enterFrameCatcher.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    }
}
private function removeEnterFrameCatcher() : void
{
    if (enterFrameCatcher && enterFrameCatcher.hasEventListener(Event.ENTER_FRAME))
    {
 enterFrameCatcher.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
    }
    return;
}
private function relistenEnterFrameCatcher() : void
{
   if (enterFrameCatcher && !enterFrameCatcher.hasEventListener(Event.ENTER_FRAME))
   {
 enterFrameCatcher.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    }
}

access MovieClips Recursively

Filed under: Flex — Tags: , , , , — nsdevaraj @ 7:55 am

access MovieClips inside layers Recursively, the below is example to stop all movieclips recursively :)

private function stopMCRecursively(mc:MovieClip) : void
{
    var ind:uint;
    if (!mc)
    {
 return;
    }
    if (mc != this)
    {
 mc.stop();
    }
    ind = 0;
    while (ind++ < mc.numChildren)
    {
 if (mc.getChildAt(ind) is MovieClip)
 {
     stopMCRecursively(mc.getChildAt(ind) as MovieClip);
 }
    }
    return;
}
 

April 11, 2008

AIR Popup

Filed under: Flex — Tags: , , , , , — nsdevaraj @ 6:16 am

Click here to have a look on AIR with multiple nativewindow instance (App also plays my Marriage video)

April 10, 2008

F3 Player

Filed under: Flex — Tags: , , , , , , — nsdevaraj @ 7:32 am

Hi, Click to have a look on MP3 player, i have created using AS3.0 with source code

April 9, 2008

Flexible MXML Editor

Filed under: Flex — Tags: , , , , , , — nsdevaraj @ 11:38 am

click here for AIR version of Flexible, for editing and modifying the MXML. Alternative for Flex Builder. This works as MXML Parser. I have plans to create SWF instead of mxml (on runtime).

April 8, 2008

Restart your flex Application

Filed under: Flex — Tags: , — nsdevaraj @ 1:16 pm

navigateToURL(new URLRequest(Application.application.url), ‘_self’);

April 4, 2008

Flex Error

Filed under: Flex — Tags: , , , , , — nsdevaraj @ 9:44 am

Check MP3 capabilities of user system using
flash.system.Capabilities.hasMP3         Other wise you will be getting
TypeError: Error #1009: Cannot access a property or method of a null object reference.
I was stuck because of that (my audio driver was not installed)

March 19, 2008

Applying Dynamic Properties for controls

Filed under: Flex — Tags: , , , — nsdevaraj @ 11:35 am

Instead of using AS3 dynamic Class for assigning dynamic properties to the DisplayObject, the below line is best alternative:

DisplayObject['property']= value

Using this i am working on mxml parser, planning for swf generator from AIR

March 18, 2008

eval in AS3

Filed under: Flex — Tags: , , , — nsdevaraj @ 7:55 am

To do this, you need to include the keyword “dynamic” as part of your class declaration, e.g., public dynamic class Foo. Then to make the call, just say:

var functionName:String = “foo” + bar;
if (this.hasOwnProperty(functionName))
this[functionName]();
reference

March 13, 2008

SWF Loader (Flash CS3)

Filed under: Flex — Tags: , , , , , — nsdevaraj @ 9:54 am

click here to see the code for loading anykind of swf files inside swf generated using Flash CS3, with Seamless effort. This example AS loads ‘1.swf’ to ‘8.swf’. For which u can control with buttons prev_btn, next_btn to navigate among them. swfLoader_mc is the movieclip used to load them. preloader_mc with loadbar_mc and myText(txt) shows the loading.

Older Posts »

Blog at WordPress.com.