This content has been marked as final.
Show 5 replies
-
1. Re: Button and JavaScript link (help)
Newsgroup_User Jan 18, 2007 4:29 PM (in response to michael-)
michael- wrote:
> I would like to know how to make a link to open in to a new window and..., I
> have been using javascript links to open images in small windows; <a
> href="images/samples/SampleSC.gif" onclick="return
> popitup('images/samples/SampleSC.gif')"> These links work in the html, and I
> would like to add this link to a button(or something) in flash 8
>
> The following is in my html to make the links work, but if I just get the
> above link somehow imbedded in to a button I think it will work from there
>
> <script language="javascript" type="text/javascript">
> function popitup(url) {
> newwindow=window.open(url,'name','height=490,width=720,scrollbars=yes');
> if (window.focus) {newwindow.focus()}
> return false;
> }
> </script>
>
All you need is one simple line in flash an none of the HTML stuff.
getURL("javascript:n_name=window.open('page.htm','thewin','width=720,height=490,scrollbars =yes');void(0);");
Take note tho, this might not work tested locally. You need to upload to server and
test it online.
Now, if you have multiple windows, change the "thewin" to something like "thewin1" "thewin2" etc...
If you keep requesting window with same name, you end up loading other content into it.
New name assure new object and new window made.
--
Best Regards
Urami
--
!!!!!!! Merry Christmas !!!!!!!
&
Happy New Year
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
2. Re: Button and JavaScript link (help)
michael- Jan 18, 2007 11:38 PM (in response to michael-)Is: n_name the name of the button?
and do I click on the frame or button and go to the action script and just past this in
Thank you!!!!!!!!!!!!!!!!!!!!!!!!!! -
3. Re: Button and JavaScript link (help)
Newsgroup_User Jan 19, 2007 1:35 AM (in response to michael-)
michael- wrote:
> Is: n_name the name of the button?
no, that's javascript function name. Do not touch this one :)
If you want to add it to button instance:
on (release) {
getURL("javascript:n_name=window.open('page.htm','thewin','width=720,height=490,scrollbars =yes');void(0);");
}
> and do I click on the frame or button and go to the action script and just past this in
Click on a button, hit F9 to open action editor and paste in the above.
GET URL is one line action, make sure that while paste it might wrap it into
two lines and cause error while testing.
--
Best Regards
Urami
--
!!!!!!! Merry Christmas !!!!!!!
&
Happy New Year
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
4. Re: Button and JavaScript link (help)
michael- Jan 19, 2007 4:34 PM (in response to michael-)Thank you, that worked! I am please that you have given me an answer that worked, what would I do with out you. -
5. Re: Button and JavaScript link (help)
Newsgroup_User Jan 19, 2007 10:49 PM (in response to michael-)
> Thank you, that worked! I am please that you have given me an answer that worked, what would I do with out you.
Most welcome :)
glad you got it working Michael
you have a nice weekend, whatever left of it :)
--
Best Regards
Urami
--
!!!!!!! Merry Christmas !!!!!!!
&
Happy New Year
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami>