Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-18-2001, 09:57 PM   #1
spoonyg
Registered User
 
spoonyg's Avatar
 
Join Date: May 2001
Location: Chicago
Posts: 470
Send a message via AIM to spoonyg
Default dynamic text, anchors, and images

Ive read the thread that Jose started, the one with the same text box loading
different content depending on which button was pressed, and the resulting
files/function that pigghost whipd up. It was very informative. great stuff!

When I searched the forums I found the original response Jesse gave Jose:
Jesse says:
I would do it by loading 3 diff text variables and changing which one was
displayed in the text box based on the user's click... but also look into the
.scroll method... you could use it like an html anchor almost (that is, if you
wanted to display all the text in one box)

Im curious about the second bit of what jesse said: "but also look into the
.scroll method... you could use it like an html anchor almost (that is, if you
wanted to display all the text in one box)"
My question has two parts:
Part 1:
can i use <a href ="#sassafrass"> Sassafrass </a>
<a name = "sassafrass"> </a> tags in dynamic text?
does anybody know if this was workd through in a thread here? or a tutorial?

Part 2 (This is the tough part that Im starting to think about):
Is there a way to have an image either change or scroll with text that is in a
dynamic text box. my example shows the text scrolling but no image change
or scrolling: http://dave.tanagram.com/templateB.html
The template is for news or other long text that may have an accompanying
image. So the text would scroll along with the image, but because the text is
dynamically feeding the text box Im not sure how the image would change...
Ive come up with: 1. it scrolls with the text. or 2. the images stay in place
and when the copy reaches a certain point the image would change. I have a
feeling that if i want the image to scroll with the text i would have to make
a content scroller(text & image). Is that right?

Im going to start working away on some of this stuff.
any theories on the <a> tag method inside dynamic text or
the image changing with the scrolling text warmly welcomed.

thanks.

Last edited by spoonyg; 12-19-2001 at 01:41 AM.
spoonyg is offline   Reply With Quote
Old 12-19-2001, 12:05 AM   #2
pigghost
Registered User
 
Join Date: Feb 2001
Location: colorado,usa
Posts: 121
Default

Hi spoonyg.......you know after jungleman's thing I played around with trying to come with a way to use anchors......

I didn't really come up with anything too useful.....the "A" tag thing definitely I couldn't get to work.......

Using .scroll worked...sort of...

What I did was set up two textfields...."display" to scroll the text in and another textfield to show the scroll value..."scrollVal"...and another one to show the maxscroll called "scrollTotal".......

Then on a mc I had this.......

Code:
onClipEvent (enterFrame) {
	_root.scrollVal = _root.display.scroll;
	_root.scrollTotal = _root.display.maxscroll;
	if (_root.scrolling == "up") {
		_root.display.scroll++;
	} else if (_root.scrolling == "down") {
		_root.display.scroll--;
	}
}
...then by scrolling I could tell where the text ended up....so something like this could be used as a sort of anchor......

on (release) {
_root.display.scroll = 6;
}

...but I think it could be very inaccurate.....I know different browsers can display text slightly differently, etc....

To tell the truth I really didn't spend much time on it.....but I still think there should be a way to scroll to a word using maybe....I'm not sure ....maybe some form of the String class.....I'm just thinking out loud....

But keep us informed on what you come up with.......it would definitely be handy......

-pg-
pigghost is offline   Reply With Quote
Old 12-19-2001, 12:51 AM   #3
spoonyg
Registered User
 
spoonyg's Avatar
 
Join Date: May 2001
Location: Chicago
Posts: 470
Send a message via AIM to spoonyg
Default

howdy pigghost! thanks for the reply. i think ive got a day maybe two to work
this out among some other details. your method is a great start for me...
im going to see what i can get down. thanks.
spoonyg is offline   Reply With Quote
Old 12-19-2001, 03:28 AM   #4
spoonyg
Registered User
 
spoonyg's Avatar
 
Join Date: May 2001
Location: Chicago
Posts: 470
Send a message via AIM to spoonyg
Default

ive made something that uses the basic html <a href> tag
and pigghosts suggestion from above.
http://dave.tanagram.com/scroll_test_a.html

pigghost, your suggestion works, but i see where it gets problematic...
its jumping to a line rather than a tag or word in the text. but still great!
im thinking: i wonder if there is a way to use a variable or some other
reference tag'd to a word in the text? as my AS skill is intermediate, so i
dont know about that one.
i dont understand what scrollVal and scrollTotal do. when i removed them
the text behaved same. are they needed? what do they do?

the <a href> works for linking outside to a new html page, but it doesnt
work for jumping down to a <a name> tag in the text itself (forgive me,
my html knowledge is pretty limited)
top part linking to text down yonder.
Code:
<a href ="#sassafrass"><font color="#FF0000"><u>Links down to text in
this paragraph a few paragraphs -- this doesn't work, yet.</u><font
color="#FF0000"></font></font></a>
<a name></a> down in the text that i used:
Code:
<a name = "sassafrass"></a><font color="#FF0000"><b>sassa sassa
afrassa</b><font color="#FF0000"></font></font>
i did notice that when i press the Links down to text... the page
reloaded and put #sassafrass after the /scroll_test_a.html
so i got: /scroll_test_a.html#sassafrass without moving down to the correct
tag location in the text field. i dont know what that means, but thought:
maybe the <a name = >, </a> is the wrong way to target the <a href> tag.

more to come.
thanks for the kickstart pg!
spoonyg is offline   Reply With Quote
Old 11-26-2002, 04:15 AM   #5
Rupert
Registered User
 
Rupert's Avatar
 
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 617
Default

Hi There, any chance of getting a look at your fla on this one Spoonyg? This is exactly what I'm trying to get to work at the moment.

Cheers,

Rupert
Rupert is offline   Reply With Quote
Old 11-26-2002, 02:49 PM   #6
spoonyg
Registered User
 
spoonyg's Avatar
 
Join Date: May 2001
Location: Chicago
Posts: 470
Send a message via AIM to spoonyg
Default

I think I cheated on that thing, but here it is anyways

hope it helps.
Attached Files
File Type: zip flash anchors.1.zip (7.1 KB, 747 views)
spoonyg is offline   Reply With Quote
Old 11-26-2002, 08:55 PM   #7
Rupert
Registered User
 
Rupert's Avatar
 
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 617
Default

Thanks for that. I'll get in and have a look once I pour some coffee down my throat this morning. I noticed the date on your post and thought - fat chance you'd still have the file. But hey there you go.

Not to blow your cover, but did I see you hanging around were here under a different name ?

Thanks for the help.
Rupert is offline   Reply With Quote
Old 11-26-2002, 09:08 PM   #8
spoonyg
Registered User
 
spoonyg's Avatar
 
Join Date: May 2001
Location: Chicago
Posts: 470
Send a message via AIM to spoonyg
Default

yep. that's me.
mrjellyd and spoonyg. really, i am just davek.
jelly does the graphics for me whilst, spoony has the .as pimp hand.

like spoony says, i did cheat in that file with some hard coding for jumping down. you might end up searching around for a newer method or maybe it works.

and if anybody needs a good graphic or as guy in chicago, i'm here and i'm cheap!
spoonyg 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 Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:21 AM.

///
Follow actionscriptorg on Twitter

 


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