1

I want to run my linked swf files on android mobile... I used adobe air for android extension in flash cs5.5 publish settings. When I published it generated filename.apk & filename.swf.

Here is the main problem is when i clicked next and previous button in one file it will not navigating to other file in android.

The individual file playing well, but I am not getting link from one file to other file using previou s and next buttons. Here is my code:

import flash.display.Loader;

import flash.events.Event;

import flash.events.MouseEvent;

// Vars
var currentMovieIndex:uint = 0;

var currentMovie:Loader;
// Put your movies here

var swfList:Array = ["apk1.swf", "apk2.swf", "apk3.swf"];

// Add the event listener to the next and previous button

previousButton.addEventListener(MouseEvent.CLICK, loadPrevious);

nextButton.addEventListener(MouseEvent.CLICK, loadNext);


// Loads a swf at secified index

function loadMovieAtIndex (index:uint) {

    // Unloads the current movie if exist


if (currentMovie) {
        removeChild(currentMovie);

        currentMovie.unloadAndStop();
    }

    // Updates the index

      currentMovieIndex = index;

    // Creates the new loader


       var loader:Loader = new Loader();

// Loads the external swf file

loader.load(new URLRequest(swfList[currentMovieIndex]));

    // Save he movie reference 

currentMovie = loader;

    // Add on the stage

addChild(currentMovie);
}

// Handles the previous button click


function loadPrevious (event:MouseEvent) {


if (currentMovieIndex) { // Fix the limit

     currentMovieIndex--; // Decrement by 1

     loadMovieAtIndex(currentMovieIndex);
    }
}

// Handles the next button click


function loadNext (event:MouseEvent) {

if (currentMovieIndex < swfList.length-1) { // Fix the limit

       currentMovieIndex++; // Increment by 1

        loadMovieAtIndex(currentMovieIndex);
    }
}

// Load the movie at index 0 by default


    loadMovieAtIndex(currentMovieIndex);   



note:i also tested above code by replacing


var swfList:Array = ["apk1.swf", "apk2.swf", "apk3.swf"];

with
var swfList:Array = ["apk1.apk", "apk2.apk", "apk3.apk"];
Lorenz Meyer
  • 19,166
  • 22
  • 75
  • 121
  • You should buy a new keyboard: The dot key gets stuck, and the shift doesn't work anymore ................. :) – Lorenz Meyer Dec 30 '14 at 19:45
  • You're not waiting for the loader to load. Add some error listeners to your loader. Are you getting an IO Error? Security Error? Network Error? Most likely you don't have permission to read files from the directory they are in. Look at my answer to this question for more details: http://stackoverflow.com/a/27573334/1457439 – BadFeelingAboutThis Dec 30 '14 at 19:52
  • that loader class working well on windows platform......but it is not working on android mobile.......in my mobile i am playing that swf's with swf player and adobe air plugin ........individual swf playing well but it not navigating to next file......help me to solve this issue.... – Niranjan Reddy Kurelli Jan 01 '15 at 18:18
  • @Lorenz Meyer i am not asking about next button on keyboard......i am asking about graphic button in flash fla file...to navigate to next and previous file – Niranjan Reddy Kurelli Jan 01 '15 at 18:31
  • @nirajan You didn't understand my joke : You wrote all lower case and many dots. I corrected this in your question. – Lorenz Meyer Jan 01 '15 at 18:36
  • And it seems your keyboard is still broken ... – Lorenz Meyer Jan 01 '15 at 18:56

0 Answers0