Skip to main content
Participating Frequently
May 21, 2009
Question

How to attach a Callto Link to a swf-file?

  • May 21, 2009
  • 2 replies
  • 1880 views

Hi,

I'm currently working on an animated skype button (swf-file) which I included into my website and I'd like to attach the following command to it:

Callto://myskypeid

It would be perfect, if - when hovering on it - it shows that it contains an active link (showing the "hand") and when clicking on it, it calls the user's skype app. to phone me on skype

So, in the adobe tutorials I found the following code for inserting a "hyperlink" to a button.

import flash.events.MouseEvent;

function gotoAdobeSite(event:MouseEvent):void
{
   var adobeURL:URLRequest = new URLRequest("http://www.adobe.com/");
   navigateToURL(adobeURL);
}

linkButton.addEventListener(MouseEvent.CLICK, gotoAdobeSite);

I customised the code:

import flash.events.MouseEvent;

function openskype(event:MouseEvent):void
{
   var Skype:URLRequest = new URLRequest("Callto://myskypeId");
   navigateToURL(Skype);
}

linkButton.addEventListener(MouseEvent.CLICK, openskype);


But the problem is that there occur "linkbutton not defined property or method" errors when running the code.

My swf or rsp. my fla file contains 10 movieclips which run one after another on the timescale, all in different layouts so that the colour changes during the "run".
I tried it with the first movieclip - layer1 - and named its instance "linkButton".
Didnt work.
Then I tried to insert another layer and attached another picture with alpha=0, converted it into a button and gave its Instance the name "LinkButton", but also didnt work.

Can someone please help me here? I suppose its just a "small" mistake and I couldn't be "so far away" from succeeding...
That would be great! Thanks for the help in advance!!

This topic has been closed for replies.

2 replies

steffxyzAuthor
Participating Frequently
May 21, 2009

Main problem is fixed - now there occured several other probs which aren't really related to the original problem.

Ned Murphy
Legend
May 21, 2009

Where are the layers you mention, on the timeline that the code you show is in or inside the movieclip?

The code for linkbutton is assigned to whatever instance is present on the frame of the timeline where it exists.

steffxyzAuthor
Participating Frequently
May 21, 2009

Hi Ned,

thanks a lot for answering! :-)

So - first i created a new .fla document. I inserted 10 pictures - for each pic I have one layer.

Maybe I misunderstood your question :-S sorry for that - but I'm a newbie and I thought I have to create for every picture - resp. movement - one layer

I attached the snapshot of the layers here... maybe you can help me here? Thanks again...

Ned Murphy
Legend
May 21, 2009

I can't see your image yet (if you plant it in the message rather than upload it it shows up quick... the uploader for these forums has been suffering).  But did you just take the raw images and place them in the layers of the timeline, or did you convert them to symbols (movieclip or button)?