| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
|
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 |
|
|
|
|
|
#2 |
|
no sleep til bedtime
Join Date: May 2001
Location: Brighton
Posts: 1,322
|
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... |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
|
thanks jim
i will try that Any other suggestions ??? Chacko Last edited by chacko; 11-29-2001 at 01:33 PM.. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
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. |
|
|
|
|
|
#5 |
|
Registered User
|
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 |
|
|
|
|
|
#6 |
|
Registered User
|
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 |
|
|
|
|
|
#7 |
|
Registered User
|
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
|
|
|
|
|
|
#8 |
|
Registered User
Join Date: Feb 2001
Location: colorado,usa
Posts: 121
|
Hi chacko...put this on your button...
Code:
on (release) {
getURL ("javascript:window.scrollTo(0,0)");
}
...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.. |
|
|
|
|
|
#9 |
|
Registered User
|
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??
|
|
|
|
|
|
#10 |
|
done
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
|
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+");");
}
Code:
on(release){
codemc.scrollTo(0);
}
__________________
tg --- what the hell was i thinking? Last edited by tg; 12-01-2001 at 09:10 PM.. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |