Solved

Special link / URL in Flash

Posted on 2004-08-25
10
166 Views
Last Modified: 2010-04-03
Hi,

I have NO Flash knowledge at all, it's just that our developer doesn't know how to do this:

We want to have a link from a specific part in a Flash. Not a link like "http://www.microsoft.com", but this is what the link would look like in HTML:

<a href="https://site.domain.com/authentication/12345/login.html" onClick="window.open(“https://site.domain.com/authentication/12345/login.html”,'','status=yes,menubar=no,yes,resizable=yes,location=no,toolbar=yes,width=800,height=600');return false;" >This is tha link!</a>

I already learned through Google that a link in Flash looks like this:

on(release)
{
getURL("http://www.flash-here.com", "_blank");
}

I hope this is possible from Flash? Please let me know....
0
Comment
Question by:georgedb
  • 4
  • 4
  • 2
10 Comments
 

Accepted Solution

by:
webas69 earned 50 total points
ID: 11894874
You can use javascript in the flash,
like this:

on(release)
{
getURL("javascript:void(window.open('https://site.domain.com/authentication/12345/login.html','','status=yes,menubar=no,yes,resizable=yes,location=no,toolbar=yes,width=800,height=600'))");
}

0
 
LVL 7

Assisted Solution

by:fixitben
fixitben earned 50 total points
ID: 11899399
I don't want any points

This is basically what webas69  said but It is another way to do it.  Create a function in the script part of the webpage.  like so

<script>
function newWin() {window.open('https://site.domain.com/authentication/12345/login.html', 'newWin', 'status=yes,toolbar=no,location=no,scrollbars=no,width=400,height=500,left=200,top=50,screenX=200,screenY=50');}
<script>

Then inside flash just call up the function

on(release)
{
getURL("javascript:newWin();")
}


I don't want any points I just wanted to point out another way to do the same thing.  Which is to create a pop-up from flash.

Also Don't try to Add this code to just the timeline have it added to a button.  If you don't most pop-up blockers will block it , but if it used on a button it should work fine with out being blocked.  But you probably arlready know this if that is the code you were using in html anyway.

Fixitben

0
 

Author Comment

by:georgedb
ID: 11900639
Hi,

Code works, except for one nasty thing: when you click on the link in the Flash, a new window opens with the page from the URL, great! However, ANOTHER _empty_ window opens. I have no idea why, cause there is only one "window.open" in the JavaSript and we don't use the extra parameter "_blank" ???

If you leave the windows open and click the link _again_ in the Flash, the window with content is refreshed, the other one remains and there isn't a third window added, so behavior seems a bit unpredictable...

The Flash isn't published on the website yet, so we click the link in the Flash design program. Might that be a reason? Any other solutions?

We choose webas69's solution, otherwise we have to change things in the Tridion component/template (=CMS); Fixitben, thanks for your comments!

This is the site where we use it: http://www.acnmobile.com/mobile/se_se/index.jsp and the link is in the Flash behind the word "här"...

Cheers,

George
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:fixitben
ID: 11908874
georgedb


That is cause it is calling on the function Javascript:void()  Which there is not a function inside the html that is void such as my function newWin() .  Since there is nothing there it does what is in the ( )  but also opens a new window for the function Void that it can't find.  So Try Mine and it should work all you have to do is add that little bit of code right below the title part of the html.  Then add the code for the on(release). It will call the function newWin() and that is it and I know it works.

Fixitben
0
 

Expert Comment

by:webas69
ID: 11909851
I put Vodi at the beginning because the window opens separately without it. But there's something I forgot to mention, if you use the function inside the standalone it will open the window every time, try it on an html  ( if you are using MX 2004 just hit F12 to do the preview in the browser)
0
 

Author Comment

by:georgedb
ID: 11910842
Hi,

We have a problem in using the Fixitben solution, as that means we have to change things in the component in Tridion, which we only want to do as a last resort.

I sent the following to the developer, this seems to work in HTML, though them you have to use a <A href="#" ...> with it:

on(release)
{
getURL("javascript:window.open('https://site.domain.com/authentication/12345/login.html','','status=yes,menubar=no,yes,resizable=yes,location=no,toolbar=yes,width=800,height=600')");
}

So, I removed the whole void thing as to my knowledge the window can be opened straight... I'll get back to you as soon as we have the results. If that doesn't work, I'm afraid we'll go for the solution with the function that Fixitben provided.

Any way, would it be fair to split the 100 points between the both of you?

Cheers,

George
0
 
LVL 7

Expert Comment

by:fixitben
ID: 11913406
I really don't care much about the points just helping people.  So What ever you want to do.  

Fixitben
0
 

Author Comment

by:georgedb
ID: 11913469
My last solution didn't work either. I'm afraid we'll go for the Fixitben solution:

<script>
function newWin() {window.open('https://site.domain.com/authentication/12345/login.html', 'newWin', 'status=yes,toolbar=no,location=no,scrollbars=no,width=400,height=500,left=200,top=50,screenX=200,screenY=50');}
<script>

Then inside flash just call up the function

on(release)
{
getURL("javascript:newWin();")
}


and I hope that works without any problem...

Cheers,

George
0
 
LVL 7

Expert Comment

by:fixitben
ID: 11913855
Hey I just noticed something you need this /  before the bottom <script>  so it will look like this </script>

<script>
function newWin() {window.open('https://site.domain.com/authentication/12345/login.html', 'newWin', 'status=yes,toolbar=no,location=no,scrollbars=no,width=400,height=500,left=200,top=50,screenX=200,screenY=50');}
</script>

Sorry I didn't realize this.

fixitben
0
 

Author Comment

by:georgedb
ID: 11914515
No prob. I'd seen that, just normal HTML syntaxis, thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question