Topic: how to open in a new window and use backButtonText = true

Hi All,

I have just purchased the simpleviewer-Pro and it ROCKS!!!

Just now I have a simple one page with the simpleviewer-Pro only.  What I want to do is have a simple home page with a button 'Gallery' that will go to the simpleviewer-Pro and use the back button on the simpleviewer-Pro to go back to the home page.

Can this be done?

Re: how to open in a new window and use backButtonText = true

rename the gallery page (index.html) to gallery.html

create your main page call in index.html and include a link to gallery.html

in options.as set showBackButton to true (this simply goes to the previous page in the browsers history so if they come to your gallery page directly it will not take them back to the main page. If you want it to do something else you need to change that goBack() function in StageManager.as)

republish the flash after you make your changes.

Mike Richards
SimpleViewer Support Team.

Re: how to open in a new window and use backButtonText = true

Hi Milker,

I would like to to use the goBack() function in StageManager.as but I am a little puzzled on what to do as I don't really want to mess anything up.

The arrow buttons are cool and I would like to use something similar as I am not a programmer.  The HTML link looks poor in comparison.

I need a link to the index.html but in the flash area can this be done?

Re: how to open in a new window and use backButtonText = true

It can be done, but there are no guides you would have to figure it out or hire someone. If you do play around with it, make a backup of the files that way you can't really screw anything up.

Remove the text piece and look how the other buttons are added both in the fla and as docs try to copy that. Goolge ExternalInterface.call and see how it's used. Basic stuff like that.

Mike Richards
SimpleViewer Support Team.

Re: how to open in a new window and use backButtonText = true

Oh man....my head hurts.

the Options.as turns on and off functions.
the simpleviewer.fla is just the black background, pre loader and all the graphics.
the stagemanager.as apperars to have the as to generate the buttons positions and all the functionality etc.

So I need to add a button graphic to the simpleviewer.fla and some how call it from the stagemanager.as.  If I need to turn it on and off I can do it from the Options.as.  Oh man this is going to be a long puzzle.

As I don't want to have any rollovers I don't need to use the RolloverButton.as the Home/Close button will be constant.

But where does the image.as and the imageAres.as fit in?

Also I assume that all the AS is combined when you compile to the SWF but why do you use AS outside the FLA file and not write all in the FLA?

Re: how to open in a new window and use backButtonText = true

Okay I think this is what you were talking about.  This is the original code.

//init optional 'back' button
if (Options.showBackButton){mBackBtn_mc = mClip_mc.attachMovie("Caption","mcBackBtn",mClip_mc.getNextHighestDepth());
mBackBtn_mc.txtText.autoSize = true;
mBackBtn_mc.txtText.wordWrap = false;
mBackBtn_mc.txtText.htmlText = "<font color="#" + ARGBHexToString(mXMLManager.captionTextColor) + "" size="" + Options.captionFontSize + "">" + Options.backButtonText + "</font>";           
mBackBtn_mc.onRelease = Delegate.create(this,goBack);   
}

If I use the last line

mHomeBtn_mc.onRelease = Delegate.create(this,goBack);   
}

And some how point it to the index.html and use the mHomeBtn_mc as my graphic or button am I on thr right line?

Re: how to open in a new window and use backButtonText = true

Yes.


Instead of attaching the caption movie clip, with the line below attach your custom movie clip with your graphic.

mClip_mc.attachMovie("Caption","mcBackBtn",mClip_mc.getNextHighestDepth());,


for mHomeBtn_mc.onRelease = Delegate.create(this,goBack) look ferther down the doc for the goBack() function this is what you want to change.

Mike Richards
SimpleViewer Support Team.

Re: how to open in a new window and use backButtonText = true

Hi Miker,

Thank you for your help.

    public function goBack(){       
        if (ExternalInterface.available) {
            ExternalInterface.call("history.back");
        }
I think the line is ExternalInterface.call("history.back");
But I can't see what the "history.back" is but I am sure this is what you mean.
Can you just add goto like www,xyz.co.uk

Re: how to open in a new window and use backButtonText = true

"history.back" is how you call the browser's back button.
Try replacing:

if (ExternalInterface.available) {
ExternalInterface.call("history.back");
}

With:

getURL("http://www.yourSite.com", "_self");
Mike Richards
SimpleViewer Support Team.