07-09-2008, 01:20 AM
|
#1
|
|
|
"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!
|
|
|
07-09-2008, 07:33 AM
|
#3
|
|
|
Quote:
Originally Posted by nathan99
are you saying you want a back to top in a textfield or what?
|
Yeah, is that possible? Thanks.
|
|
|
07-09-2008, 10:01 AM
|
#4
|

 |
Halley Research Station,
Latitude 75°35' S,
Longitude 26°39' W,
Brunt Ice Shelf,
Coats Land,
Antarctica |
|
 |
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
__________________
©2006 GlosRFC - Searching 8,168,684,336 brain cells
|
|
|
11-25-2008, 12:56 PM
|
#7
|
|
|
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
|
|
|
11-25-2008, 03:23 PM
|
#8
|

 |
Halley Research Station,
Latitude 75°35' S,
Longitude 26°39' W,
Brunt Ice Shelf,
Coats Land,
Antarctica |
|
 |
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
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 10:38 PM.
|
|