Back button in flash

hi,
How to make “back button” in flash5 but the button is used to bring back the user to the last view of the html page? Thx…

If I am understanding correctly you want to go back an html page right?

You can use javascript for that (in a getURL in Flash of course)

on (release){
getURL("java<I></I>script:history.back(-1)", "_self");
}

hey lostinbeta, how do you know so much!?! anyway, i wanted to ask you what frame rate you use on your site, the slide works really well and is quite smooth

I learned Javascript before I even heard about AS :slight_smile:

And Frame Rate… hmmmm… :wink:

My site is Javascript and DHTML using the scrollTo(x,y) function in Javascript (doesn’t work in NS :() so there is no frame rate, just a scroll speed.

:o guess I shoulda right mouse clicked . . .

you see, they outta make a law banning 18 year olds from doing this stuff, sort of like alcohol, sex and driving. they all gots laws so you don’t get too good at it too early (makes us old farts feel inadequate)

thanks for the info and i really like your site :elderly:

lol, well if it helps, I got a basic form of the script from someone else, and I modified it for my usage of 3 iframes :slight_smile: I am really bad at DHTML :(, but Javascript I am pretty good with I think :beam:

Thanks for the compliments :slight_smile:

I like your site too, the right and bottom are cut off on my 800x600 monitor, and the content area isn’t defined it is just kind of there, but besides those, its pretty nice. I like the navi, its nice and clean and I like how it scrolls the image at the top :slight_smile:

yeah, the size was made for 1024 but with the hopes that most could see the main stuff and all the nav at 800

you are the first to critique my site (self-esteem too low to post it on site critique here)

what did you mean about the content just being out there? i placed it on a bright pic for a background but would love more feedback. i don’t have any art background and I need to do some type of transition for the background, like:

function show(num) {
	//transition current content OR add new content
	var sections = ["main", "section_1", "section_2", "section_3"];
	if (typeof (currentNum) != "undefined" && num != currentNum) {
		_root[sections[currentNum]+"_mc"].gotoAndPlay("out");
	} else {
		_root.attachMovie(sections[num], sections[num]+"_mc", 1, {_x:10, _y:10});
	}
	currentNum = num;
	//show frame on active button
	for (var i = 1; i<=4; i++) {
		if (i != num+1) {
			_root["menuButton_"+i].frame._visible = false;
		}
	}
	_root["menuButton_"+(num+1)].frame._visible = true;
}
_global.outDone = function(target) {
	target.removeMovieClip();
	show(currentNum);
};
menuButton_1.buttonLabel.text = "Main";
menuButton_1.onRelease = function() {
	show(0);
};
menuButton_2.buttonLabel.text = "Section 1";
menuButton_2.onRelease = function() {
	show(1);
};
menuButton_3.buttonLabel.text = "Section 2";
menuButton_3.onRelease = function() {
	show(2);
};
menuButton_4.buttonLabel.text = "Section 3";
menuButton_4.onRelease = function() {
	show(3);
};

this is for moviclips but I need a way to apply it to my scenario,

anyway, any suggestions from you would carry a great deal of importance and would be well apprecia
ted :eye:

Well I have to go real soon, so I don’t have time to figure out what to do with your code.

But what I meant about your content just being there is that there is a lot of empty area around your content box. I am thinking maybe just add a border there of or something, to defined the area better.

And OMG, I just noticed that subQuark actionscript button at the bottom… EXCELLENT IDEA!!! I am so about to copy you on that when I release my Flash site so people won’t constantly e-mail me the same questions over and over :slight_smile:

You should definitely post your site in the Site Check section though :slight_smile:

copy away, all you like. the reason for the code is that i don’t have any real actionscript stuff to display (ie, experimental) and when i was contracted for a project a few months ago, they asked to see some code examples and my response was basically: doh!

so when i remade my site, i thought i’d do this to at least fake it a bit!

i’ll play around with the border idea, you’re right, allthe nav has a black border, so maybe the content should too. i never looked at it like that. see, i told you your input was good.

i guess i’ll post on the site critique when this transition thing is figured out (non-destructive refresh as Robert Reinhardt puts it, it’s his code up there), but I think I may have to put the section backgrounds in the main swf to use this type of code, rather than in each loaded swf

thanks again for the great input

no problem man :slight_smile: