Skip to main content
Participating Frequently
Jun 8, 2011 11:14 AM UTC
Answered

Replay of flash file

I have made one sample.apk for Android using Flash CS5.5. The flash file contains some animations on each frame. Now when I test my application in android emulator, it's not launching from start(i.e. from first frame). It always show me the last visited frame(the last time where I left my application). Could anybody tell me how to launch application from start?

This topic is closed to new replies. Start a new post to keep the conversation going.
relaxatraja
relaxatrajaCorrect answer
Inspiring
Jun 8, 2011 12:31 PM UTC

Then write the code to exit when you back:

stage.addEventListener( KeyboardEvent.KEY_DOWN, handleKeyDown );

NativeApplication.nativeApplication.addEventListener( KeyboardEvent.KEY_DOWN, handleKeyDown );

NativeApplication.nativeApplication.addEventListener( Event.DEACTIVATE, handleDeactivate );

function handleKeyDown( e :KeyboardEvent ) :void
{
    switch( e.keyCode )
    {
        case Keyboard.BACK:
            NativeApplication.nativeApplication.exit();
            break;
        case Keyboard.SEARCH:
        case Keyboard.MENU:
            e.preventDefault();
            break;
    }
}

function handleDeactivate( e :Event ) :void
{
    NativeApplication.nativeApplication.exit();
}

4 replies

relaxatraja
Inspiring
Jun 8, 2011 11:47 AM UTC

From the emulator:

Settings>Applications>Manage Applications>[select your running apk file]>[use Force stop] (or) [uninstall to remove the application]

Translate
Participating Frequently
Jun 8, 2011 12:07 PM UTC

Thanks for the reply!!

I know we can do this, but I was looking for alternate method because each time we need to remove and again install that application.  

Translate
relaxatraja
relaxatrajaCorrect answer
Inspiring
Jun 8, 2011 12:31 PM UTC

Then write the code to exit when you back:

stage.addEventListener( KeyboardEvent.KEY_DOWN, handleKeyDown );

NativeApplication.nativeApplication.addEventListener( KeyboardEvent.KEY_DOWN, handleKeyDown );

NativeApplication.nativeApplication.addEventListener( Event.DEACTIVATE, handleDeactivate );

function handleKeyDown( e :KeyboardEvent ) :void
{
    switch( e.keyCode )
    {
        case Keyboard.BACK:
            NativeApplication.nativeApplication.exit();
            break;
        case Keyboard.SEARCH:
        case Keyboard.MENU:
            e.preventDefault();
            break;
    }
}

function handleDeactivate( e :Event ) :void
{
    NativeApplication.nativeApplication.exit();
}

Translate