Solved

Special link / URL in Flash

Posted on 2004-08-25
10
164 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

919 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now