Old 07-09-2008, 01:20 AM   #1
lillies123
Registered User
"back to top"

Hi,
I have a file full of text; if this were html, I'd just make an iframe and in the frame, I'd have the text page with "back to top" links throughout. But since this is flash, I'm loading an external text file, and I'd like some "back to the top" links within it. I know how to do a "back to the top" in html, but it doesn't seem to work in a loaded text file in flash. Or is there a better way to present a lot of information in flash? What would you suggest?
I've been agonizing over this for days and I'd appreciate any help at all.Thanks!
lillies123 is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?

Old 07-09-2008, 04:49 AM   #2
nathan99
d[o.o]b
 
nathan99's Avatar
Location Frankston, Australia

Posts 4,151
are you saying you want a back to top in a textfield or what?

__________________
nathan99 is offline   Reply With Quote
Old 07-09-2008, 07:33 AM   #3
lillies123
Registered User
Quote:
Originally Posted by nathan99 View Post
are you saying you want a back to top in a textfield or what?
Yeah, is that possible? Thanks.
lillies123 is offline   Reply With Quote
Old 07-09-2008, 10:01 AM   #4
glosrfc
Registered User
 
glosrfc's Avatar
Location Halley Research Station, Latitude 75°35' S, Longitude 26°39' W, Brunt Ice Shelf, Coats Land, Antarctica

Posts 4,774
It's possible, using the asfunction:
Code:
stop();
//create function to scroll to the anchor point
function scrollAnchor(anchor) {
	trace(anchor);
	textArea.scroll = anchor;
}
// load external textfile into textfield
var lv = new LoadVars();
lv.onData = function(inString){
   textArea.htmlText = inString;
}
lv.load("anchor.txt");
Your textfile should contain anchor tags that contain an asfunction that references the scrollAnchor function as well as the anchor argument you wish to pass .e.g. <a href="asfunction:scrollAnchor,1">Back to top</a>
Your anchor argument can be any valid horizontal line in your textfield so there's no reason why you can't create links to jump forwards as well as backwards.

A sample is attached and further information about asfunction can be obtained here or by checking the help files ActionScript language elements > Global Functions > asfunction protocol
Attached Files
File Type: zip anchor.zip (6.2 KB, 55 views)

__________________
©2006 GlosRFC - Searching 8,168,684,336 brain cells
glosrfc is offline   Reply With Quote
Old 07-09-2008, 10:50 AM   #5
lillies123
Registered User
Oh! Awesome! Thanks so much, Glosrfc! I really appreciate your help.
lillies123 is offline   Reply With Quote
Old 10-03-2008, 01:38 PM   #6
octavio
Registered User
this is great help, thanks
octavio is offline   Reply With Quote
Old 11-25-2008, 12:56 PM   #7
fruitbeard
Registered User
anchor links

Hi there, i see what your actionscript did, but can you jump to certain <a name='go-here'>THIS PARAGRAPH</a>. parts of the same textfield.

Thanks upfront
fruitbeard is offline   Reply With Quote
Old 11-25-2008, 03:23 PM   #8
glosrfc
Registered User
 
glosrfc's Avatar
Location Halley Research Station, Latitude 75°35' S, Longitude 26°39' W, Brunt Ice Shelf, Coats Land, Antarctica

Posts 4,774
That code calls the scrollAnchor function which uses the scroll property to search for a specific line that's passed in as an argument of the asfunction call. You can use the same code providing that you know on which line the GO HERE anchor is likely to appear.

The other option is to write your own function. I'd suggest doing a search for asfunction anchor..these links might help start you off:
http://blog.circlecube.com/2008/05/3...tion-tutorial/
http://www.flashmagazine.com/tutoria..._flash_frames/

__________________
©2006 GlosRFC - Searching 8,168,684,336 brain cells
glosrfc is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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


All times are GMT -4. The time now is 10:38 PM.

SHARE:

SUPPORTERS:

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com