Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6002499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:59:14+00:00 2026-05-23T00:59:14+00:00

Just wondering if anyone could help me with this. I’m new to actionscript, and

  • 0

Just wondering if anyone could help me with this. I’m new to actionscript, and am building an application that plays some sounds when buttons are clicked.

It’s got 5 tabs, and will give the user the options to play about 10 sounds per tab.

I have initially been loading the sounds on runtime, so whenever the user clicked a button to play that sound, I would do something like:

var sound:Sound = new Sound(new URLRequest("assets/hello.mp3"));
sound.play();

I’m not sure, but I don’t think this is very good, since I would be loading that sound over and over again if the user pressed the button too many times.

I then thought about embedding the sound in each of the views (I have one view per tab), so would embed the sounds whenever the view was loaded. I think this is a better options, but still am a bit unsure about how the embed works exactly.

[Embed('assets/hello.mp3')] private var hello_mp3:Class;

I suppose it simply embeds the mp3 files when the swf is compiled (making it bigger), but they would not be loaded anymore once the app starts, or once that view is initialized again.

My question is: Is this the right approach to take? Is there any better way I can accomplish this? Is embedding the right solution for my problem?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:59:14+00:00Added an answer on May 23, 2026 at 12:59 am

    The first solution works fine, it won’t make your SWf bigger and once the sound has been loaded once, it will be cached by Flash Player, so the sound is not loaded again and again.

    This is a more efficient approach, sounds that are not played will not be loaded.

    Bear in mind that when the button is pressed for the first time , you may experience a slight delay due to the sound being loaded.

    In order to avoid this, you can load some sounds as external assets, meaning that after your SWF has loaded, you can call a function that will load some or all of the sounds, depending on the needs of the app. Your SWF will not be bloated and the button click will be more responsive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just wondering if anyone could help out with how to do the
just wondering if anyone could suggest why I might be getting an error? I'm
Hey guys I was wondering if anyone could help me with an issue im
Hi guys just wondering if somebody could help me try and correctly thread my
just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview
Just wondering if anyone has any favourite SQL references they to use when creating
Just wondering if anyone knew off the top of their heads if there was
I was just wondering if anyone else just sees integration tests as just a
I've just started using Linq to SQL, and I'm wondering if anyone has any
I'm studying some source codes and I'm just wondering why a class (or classes)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.