How to Put a Radio Station Into a SWF

Written by justen everage
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Put a Radio Station Into a SWF
Integrating radio stations in a SWF file allows off-site hosting of live audio. (Hemera Technologies/ Images)

There are a few ways to integrate sound in a SWF file. To save server space and allow for continuously fresh content, developers may want to host audio on a separate server, or stream it directly from an Internet radio station. The best way to stream Internet radio stations in SWF files is to allow an external client to render the audio. Creating a hyperlinked button in your Flash project will allow users to play the audio via their computer's default music player. Streaming audio from an off-site server decreases bandwidth usage, among others things, and can reduce the expenses associated with hosting large files. A basic familiarity with Adobe Flash and ActionScript is required for this project.

Skill level:

Other People Are Reading

Things you need

  • Adobe Flash CS4 or higher

Show MoreHide


  1. 1

    Open a Flash project in Adobe Flash. Create a new frame and select "Insert" from the main menu. Choose the "New Symbol" option and select the "Button" option. Check the "Behavior" function for the button, so that it relies on users to click it before functioning. Continue in this menu to create the name of the button, then select an image file to visually represent it.

  2. 2

    Select the button's keyframe, and choose "Window" from Flash's main menu. Select "Actions" and insert the following generic button code ActionScript:

    Button.addEventListener(MouseEvent.CLICK, ButtonFunction);

    function ButtonFunction(event: MouseEvent) {var request:URLRequest = new URLRequest("EXAMPLE.asx or EXAMPLE.wma"); navigateToURL(request, "_self");}

  3. 3

    Change the "example" line in the above script to the URL of the Internet radio station stream. WMA and ASX file formats are common for Internet radio, and will automatically open the default audio player assigned to handle these formats on a user's computer.

Tips and warnings

  • ASX allows for more diverse and condensed audio formatting than WMA. Select a station with ASX stream formatting if possible.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.