R
Ritchie Valens
Hi,
I was wondering, how different is Javascript, from Actionscript 3.0?
I am messing around with a web radio application, I am trying to
create.
I am a newbie but more used to AS 2.0, but I finally took the plunge
and forced myself to learn AS 3.0.
Basically everytime a button is pressed, it goes to the next Radio
Station:
As Below, but I think there must be a simpler way, without repeating
the code.
Any suggestions,
Please keep it simple, and would you be kind enough to explain, what
you have done?
The right Braces at the end bother me, they look silly, which is why I
thought there is an easier way
Regards
//Stop Script
stop();
// up Button Script Jazz fm
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.jazzfm.com"));
gotoAndStop(2);
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio1"));
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio2"));
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio3"));
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio4"));
}}}}}
Life is Good !!!
I was wondering, how different is Javascript, from Actionscript 3.0?
I am messing around with a web radio application, I am trying to
create.
I am a newbie but more used to AS 2.0, but I finally took the plunge
and forced myself to learn AS 3.0.
Basically everytime a button is pressed, it goes to the next Radio
Station:
As Below, but I think there must be a simpler way, without repeating
the code.
Any suggestions,
Please keep it simple, and would you be kind enough to explain, what
you have done?
The right Braces at the end bother me, they look silly, which is why I
thought there is an easier way
Regards
//Stop Script
stop();
// up Button Script Jazz fm
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.jazzfm.com"));
gotoAndStop(2);
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio1"));
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio2"));
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio3"));
up_btn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 ( event:MouseEvent):void
{ navigateToURL (new URLRequest ("http://www.bbc.co.uk/radio4"));
}}}}}
Life is Good !!!