Groups | Blog | Home
all groups > flash (macromedia) > november 2005 >

flash (macromedia) : getUrl to 'dynamic' named anchor


PJ
11/17/2005 11:55:45 PM
I am trying getUrl to link to dynamically generated named anchors in a html
page where the .swf is located. A variable ~gobook~ is created depended on
some buttons clicked, then I need to add it to a getUrl code.

Fixed named anchor string I get working fine, when I use

getURL(javascript:window.location.href="#astropjas4a");

it works as I need it to (page going to named anchor in html correctly)


when I use

gobook = "astropjas4a"
getURL('javascript:window.location.href="#' add gobook add '"');

it does not (page going to url
javascript:window.location.href="testingpagename.htm#astropjas4a" and
showing testingpagename.htm#astropjas4a as content of page)

anybody knows or sees a syntax error?
t.i.a.
P.


PJ
11/18/2005 12:00:00 AM
[quoted text, click to view]

well... that is possible. I usually don't work with flash triggering a link
to a named anchor, so it's rather new to me too.

[quoted text, click to view]

surprising... that worked ;)
I simply 'presumed' it needed javascript, that was what I found from google
group search, see
http://groups.google.com.br/groups?hl=en&q=group%3A*flash*+getUrl+bookmark+named+anchor
for threads about it.

[quoted text, click to view]

No... but I simply got used to it and never changed since I found 'add'
preferable for two reasons, it helps me when using Find in scripts for
concatenation and it also makes it easier to distinguish in scripts between
concatenations and mathatecal calculation. And "add" always kept working
fine untill now. Unfortunately with flash 8 "add" has a new purpose for
vector or point definition or something like that so I now really do have to
start updating everything... what comes around goes around ;)

tnx for the help
[]z
P

Wolf van Ween
11/18/2005 9:40:10 AM
PJ, are you typing this from memory? There are a number of syntax problems.
I'm astonished it works in the first case. Maybe because the interpreter
ignores the first part of the parameter and only executes
getURL("#astropjas4a")???

One possible correct line would be
getURL("javascript:window.location.href=#"+gobook);

But why do you use javascript at all? You could simply write
getURL("#"+gobook, "_self");
Wolf
PS The "add" was deprecated in Flash 5 already, or are you still working with
version 4?

AddThis Social Bookmark Button