Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > Projectors and CDs

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-28-2001, 11:51 AM   #1
chacko
Registered User
 
Join Date: Nov 2001
Location: in a little island of dreams
Posts: 30
Send a message via Yahoo to chacko
Question moving to top of page

hai all

i have created a flash page which is very big ;-). you must scroll down to see the entire page(contains lot of text). my problem is that i want to put a button at the bottom of the page which if clicked move the focus to top of the page.

can anyone help me in this regard ??

Chacko
chacko is offline   Reply With Quote
Old 11-29-2001, 09:37 AM   #2
jimburton
no sleep til bedtime
 
jimburton's Avatar
 
Join Date: May 2001
Location: Brighton
Posts: 1,322
Default

You could try using the Selection object and setFocus on an input field, although I've not tried to jump around the page myself in this way.

I think there's a tutorial on setFocus if you want to have a look...
jimburton is offline   Reply With Quote
Old 11-29-2001, 01:27 PM   #3
chacko
Registered User
 
Join Date: Nov 2001
Location: in a little island of dreams
Posts: 30
Send a message via Yahoo to chacko
Smile thanks

thanks jim

i will try that

Any other suggestions ???

Chacko

Last edited by chacko; 11-29-2001 at 01:33 PM..
chacko is offline   Reply With Quote
Old 11-30-2001, 05:16 AM   #4
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

Why not just use an HTML anchor at the top of the page?
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 11-30-2001, 02:48 PM   #5
Taldos
Registered User
 
Join Date: Oct 2001
Location: PA
Posts: 91
Send a message via AIM to Taldos
Default

if u are already using a scroll bar why not just reset the value of the scroll back to it's original position. that would bring you back to the top of the page.

le me know if that makes sense

thanx and be well
Taldos is offline   Reply With Quote
Old 12-01-2001, 06:51 AM   #6
chacko
Registered User
 
Join Date: Nov 2001
Location: in a little island of dreams
Posts: 30
Send a message via Yahoo to chacko
Smile

hai

thanks for u r replies

Jesse, how can i make a HTML Anchor to the top of page from the bottom of the flash page.?

Taldos, the scroll bar is not which i created in flash. its of the browser. any other way ?

can u help!!!!!!!!

Chacko
chacko is offline   Reply With Quote
Old 12-01-2001, 02:15 PM   #7
Taldos
Registered User
 
Join Date: Oct 2001
Location: PA
Posts: 91
Send a message via AIM to Taldos
Default

if that is the case then your code has to be done in html as you are telling the window itself to reset the focus. don't konw much about html, perhpas someone else could help you out there
Taldos is offline   Reply With Quote
Old 12-01-2001, 04:38 PM   #8
pigghost
Registered User
 
Join Date: Feb 2001
Location: colorado,usa
Posts: 121
Default

Hi chacko...put this on your button...

Code:
on (release) {
getURL ("javascript:window.scrollTo(0,0)");
}
...I've played around with this some, and it seems to work in most browser/OS combinations with PC (not sure about MAC, though)

...the two parameters in window.scrollTo(x,y) are the x/y coordinates of the window..."0,0" takes you to the upper left....by changing the "y" you can jump around to different positions on the Flash page much like an HTML anchor...

Hope this helps...

-pigghost-

EDIT: For some reason I keep getting a space between "java" and "script"...that shouldn't be there...it's one word....

Last edited by pigghost; 12-01-2001 at 04:42 PM..
pigghost is offline   Reply With Quote
Old 12-01-2001, 07:23 PM   #9
Taldos
Registered User
 
Join Date: Oct 2001
Location: PA
Posts: 91
Send a message via AIM to Taldos
Default

hey i have a question concernig such a use of java script from flash. can you use that same method for any other java piece of code and does your flash have to be published in html or can it be an swf file??
Taldos is offline   Reply With Quote
Old 12-01-2001, 08:38 PM   #10
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

if you use this in a projector.exe, when you use the action getURL, your projector will open up your browser with no page loaded and the javascript in the location bar (at least with ie/pc).

you can also wrap pighosts code like this

Code:
Movieclip.prototype.scrollTo=function(ypos){
	getURL("javascript:window.scrollTo(0,"+ypos+");");
}
then use it like this anywhere.
Code:
on(release){
	codemc.scrollTo(0);
}
here is an example with source.
__________________
tg
---
what the hell was i thinking?

Last edited by tg; 12-01-2001 at 09:10 PM..
tg is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing radio button variables/values acperez ActionScript 1.0 (and below) 10 03-17-2006 01:20 PM
on release function to take me to top of page gurx33 ActionScript 1.0 (and below) 1 02-10-2005 01:32 AM
PIXELWIT flipping page book changes happyjime ActionScript 2.0 4 08-14-2004 01:09 PM
How can I add more buttons? diggz ActionScript 1.0 (and below) 0 03-31-2004 07:14 AM
Flash: Setting page top, anchor tags and Browser Back zmotiv ActionScript 2.0 0 03-29-2004 08:42 PM


All times are GMT. The time now is 05:35 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.