# Flash CS5.5 - AS2 - How to insert a java script into a flash movie - Need help

**URL:** <https://forum.kirupa.com/t/flash-cs5-5-as2-how-to-insert-a-java-script-into-a-flash-movie-need-help/329581>\
**Category:** flash\
**Created:** [September 18, 2012, 4:22am UTC](https://forum.kirupa.com/t/flash-cs5-5-as2-how-to-insert-a-java-script-into-a-flash-movie-need-help/329581 "2012-09-18T04:22:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddiojp](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@eddiojp](https://forum.kirupa.com/u/eddiojp)\
**Post date:** [September 18, 2012, 4:22am UTC](https://forum.kirupa.com/t/flash-cs5-5-as2-how-to-insert-a-java-script-into-a-flash-movie-need-help/329581/1 "2012-09-18T04:22:21Z")

</div>

Hello everybody  
Thank you very much in advance

I have done an intesive graphics website for a friend (the oldschool way) using adobe fireworks. you can see it in this link

[http://tuguiaderepuesto.com](http://tuguiaderepuesto.com)

the problem with this site has to do with screen resolution, so the answer to this was rebuilding it flash (I use Adobe Flash CS5.5)…

I already tried with some modest sucess (you can see it in this link)  
[http://tuguiaderepuesto.com/index2.html](http://tuguiaderepuesto.com/index2.html)

But there´s something I can´t do for now… and is to inser the radio player on the dashboard.

Here is the java script code

\<script type=“text/javascript” src=“[http://www.lorini.net/platform](http://www.lorini.net/platform)”\>\</script\>  
\<div id=“player”\>\<a href=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)”\>Requiere Flash Player\</div\>  
\<script type=“text/javascript”\>  
// SET THE FOLLOWING VARIABLES ACCORDING TO YOUR STREAM  
var stream = ‘[http://lortel58.lorini.net:1050/RADIOCONTACTO](http://lortel58.lorini.net:1050/RADIOCONTACTO)’;  
var autostart = ‘true’;  
// DO NOT EDIT ANYTHING UNDER THIS POINT  
var so = new SWFObject(‘[http://www.lorini.net/hd’,‘mpl’,‘180’,‘20’,‘9’,frontcolor=’#000000](http://www.lorini.net/hd','mpl','180','20','9',frontcolor='#000000)’);  
so.addParam(‘allowscriptaccess’,‘always’);  
so.addParam(‘allowfullscreen’,‘false’);  
so.addVariable(‘autostart’, autostart);  
so.addVariable(‘file’, stream+’%3Ftype%3D.flv’);  
so.write(‘player’);  
\</script\>

I don´t know if there´s a way to embed java script code into flash or if there´s a way to workaround this. I´m open to suggestion.  
Any idea will be welcome

Thank you very much for your kind attention  
Best reggqards

Eddio Piña  
From Venezuela
