PDA

View Full Version : read url address



amaze
February 2nd, 2004, 11:20 AM
How do I read the url address i currently am in, using AS?

I want to be able to read the variables passed and display different things each time.


I've seen that before, searched this site for that, but nothing...
I'm a little dizzy with the work and all.
:sigh:

thanks all.

Johnny64
February 2nd, 2004, 01:14 PM
trace(_url);

amaze
February 3rd, 2004, 02:49 AM
thank you master.
is it possible to use an if like this one?

if (trace(_url) == services.cfm?*) {
//perform these actions
}

where (*) is many pageID's..

is there a (%) symbol for that purpose?
thx

eyezberg
February 3rd, 2004, 03:56 AM
_url returns the full url, you can then use string methods to "cut it up", and then check on the individual pieces..get rid of the trace()!
that's just to display it in the output window.
I did not fully understand what you want to do there..?

amaze
February 3rd, 2004, 04:18 AM
if (_url eq "http://www.amaze.gr/about.cfm?ContID=42") {
gotoAndPlay(2);
} else {
stop();
}

What I want to do is when in different ContID's (page ID's) to perform different actions.

BUT, _url returns the path of the swf file.
How can I solve this one?

eyezberg
February 3rd, 2004, 04:29 AM
Does the swf's path include the ContID or not?
Why not set the var in the swf, instead of get it, using flashvars for example..?

amaze
February 3rd, 2004, 04:35 AM
This is a flash menu. ok?
In the beginning it's in a cfm page "http://www.amaze.gr/index.cfm".

When I click on a link let's say "services" the page turns to "http://www.amaze.gr/services.cfm".

I want to check the url and let's say change the color of the "services" button.

Forget the ID's.
If I can do the URL check I can do it with ID's too.

I hope you get it this time.
Thank you for your time m8.

amaze
February 3rd, 2004, 07:34 AM
Ok. I found the solution.

All I head to do is declare a variable in the embed source:

<embed src="swf/amaze_flash.swf?strURL=services"...blah blah blah...

Thanks u 2 for your help.
Maybe I'll need the _url thing sometime.