Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Special link / URL in Flash

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
georgedb
Asked:
georgedb
  • 4
  • 4
  • 2
2 Solutions
 
webas69Commented:
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
 
fixitbenCommented:
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
 
georgedbAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
fixitbenCommented:
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
 
webas69Commented:
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
 
georgedbAuthor Commented:
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
 
fixitbenCommented:
I really don't care much about the points just helping people.  So What ever you want to do.  

Fixitben
0
 
georgedbAuthor Commented:
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
 
fixitbenCommented:
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
 
georgedbAuthor Commented:
No prob. I'd seen that, just normal HTML syntaxis, thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now