Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-15-2002, 09:06 AM   #1
toxalot
Registered User
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 85
Default HTML Link and onClick

I have several popup links in my web page like what I want and they work great. I now need one in my Flash movie and wondering how I would get the same effect.

My HTML code is as follows:

<a href="/diy_postcard_prices.html" target="newWindow" onClick="PopUp(this.href, 'newWindow', 510, 450); return false">

The effect I want is for the link to open in the pop up if possible, but will still work if Javascript is disabled.

Jennifer
toxalot is offline   Reply With Quote
Old 10-18-2002, 07:58 PM   #2
toxalot
Registered User
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 85
Default

Anyone?

I can think of different ways of doing an HTML link OR JS link, but can't think of a way of having a JS link and only use HTML if no JS.

I really like having it be a pop up, but still want the link to work even if JS disabled.

Jennifer
toxalot is offline   Reply With Quote
Old 10-18-2002, 11:52 PM   #3
jimburton
no sleep til bedtime
 
jimburton's Avatar
 
Join Date: May 2001
Location: Brighton
Posts: 1,322
Default

you could do something like wait til the movie is loaded and send a message from javascript to the movie nd if it gets there then you know you're working, do the pop-up, therwise just link to a new page...maybe:

ActionScript Code:
//in the web page function sayHello() { document.movie.SetVariable("saidHello","true"); } //in the movie saidHello = false; getURL("javascript:sayHello();"); if(!saidHello) { //do one thing } else { //do the other }

providing your movie has the name and id parts of the html tags set to 'movie'

learning from experience, I tried this code and it works
jimburton is offline   Reply With Quote
Old 10-19-2002, 01:53 AM   #4
toxalot
Registered User
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 85
Default Can't get it to work

I tried the code as is. Ensuring that JS is enabled and the name attribute of the embed tag is set to movie as well as id in the object tag.

saidHello is always false

The Mozilla debugger says
document.movie.SetVariable is not a function

I tried adding swLiveConnect=true and using window.document.movie.SetVariable("saidHello","tru e");

as described here
http://www.macromedia.com/support/fl...htm#javascript

And still doesn't work. The function is getting called. I know cuz I added an alert to see.

Jennifer
toxalot is offline   Reply With Quote
Old 10-19-2002, 07:06 PM   #5
jimburton
no sleep til bedtime
 
jimburton's Avatar
 
Join Date: May 2001
Location: Brighton
Posts: 1,322
Default

sorry, only tried it in IE - the SetVariable and assoc functions only work in IE, so this approach has a limited usefulness, but it's the only one I can think of...if you run the attached files in IE you'll see it working...

If I were you I would be happy to lose the tiny minority of people who turn off javascript unless you're doing a government or other 100% accessible site, in which case pop-ups probably aren't the thing...?
Attached Files
File Type: zip untitled-2.zip (3.0 KB, 174 views)
jimburton is offline   Reply With Quote
Old 10-19-2002, 09:39 PM   #6
toxalot
Registered User
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 85
Default

I had tried it in IE too and couldn't get it to work there although I didn't get the error. I will try yours and see if I get that one to work and what I did differently.

I have JS turned on, but JS only links are one of my biggest surfing pet peeves. I use my middle mouse button to open in a new tab and I can't do that with a JS link. It really bugs me when I am not given the choice. I also want to know the url of where I am going.

Jennifer
toxalot 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 05:44 PM.

///
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.