Topic: Defaulting to the last image

Hi, I'm trying to get Autoviewer to start with the lastest image added to the xml array.

I found that the first image to be displayed is defined in the stagemanager.as init function variable "mCurrentImageIndex". The value defined is "0" in the original script.

I tried to trace the lenght of the image array within the init function, but to no avail.  If I could get the lenght of the array, I could define "mCurrentImageIndex" as the lenght of the array to default to the last image when the viewer starts.

How could this be done?

Re: Defaulting to the last image

I managed to find an alternative solution. Althought this does not directly adress the problem I brought up, it does accomplish what I wanted.

What I did is make the default page initiated (0) become a variable.

Thus, when the sm.init(this) class is called in the main .fla, I added a second parameter:

sm.init(this,imagenumber);

in the stagemanager.as file I changed:

public function init(target:MovieClip):Void{

to

public function init(target:MovieClip,imagenumber:Number):Void{

and then

mCurrentImageIndex = 0;

to

mCurrentImageIndex = imagenumber;

This way I can specify which image I want to load first directly from within my main swf file. You can even specify the image with loadvars from your querystring.

Re: Defaulting to the last image

I got everything working now! See my other post...

Re: Defaulting to the last image

Hi,

Your solution sounds just like it´s just what I´m trying to do.

Unfortunately I can´t get it to work.

You talk of the following line but I can´t locate it anywhere:
mCurrentImageIndex = 0;

I can only find references to the mCurrentImageIndex -variable in "ImageArea.as".
At one place it reads "mCurrentImageIndex = -1;" ...is this where I should modify?

I would appreciate help with getting this to work the way you describe

Thanks!