Hi All!
I've got a streaming MP3 from a folder on the site to load on PLAY/STOP buttons, and volume slide okay, but I need it to AUTO PLAY when on a frame of the movie. It's about 2mb.
(just so when you get into the site the background music plays auomatically, then the user can adjust volume or stop if they need to)
Any ideas?
(Here's my actionscript) How can I add to this script to auto play the file as well? -
var mySound:Sound = new Sound();
-
mySound.loadSound("mySound.mp3", true);
-
mySound.stop();
-
btnStop.onRelease = function():Void {
-
mySound.stop();
-
};
-
btnPlay.onRelease = function():Void {
-
mySound.start();
-
};
-
var nVolCheck:Number;
-
mcVolSlider.volBall.onPress = function():Void {
-
this.startDrag(false, 0, 0, 400, 0);
-
nVolCheck = setInterval(updateVolume, 100);
-
};
-
mcVolSlider.volBall.onRelease = function():Void {
-
this.stopDrag();
-
clearInterval(nVolCheck);
-
};
-
function updateVolume():Void {
-
var vol:Number = (mcVolSlider.volBall._x)/4;
-
mySound.setVolume(vol);
-
mcVolSlider.volBall.volText.text = vol;
-
}
-
any ideas at all would be helpful!
Thanks in advance guys!
=)
4 3180
Hi All,
no ideas at all? :)
Hi, elamberdor!
The script that you posted is for the background music, isn't it?
If you want the code to start playing as soon as it finished loading you can do it but setting the start method inside it's onload. Like this: -
mySound.onLoad = function(success) {
-
if(success) {
-
this.start();
-
}
-
}
-
In any case, your sound is streaming, so you can just do mySound.start() and it will start playing what has already loaded.
Please post back and tell me if this answers your question.
Kind regards,
The_Nephilim
PD: Sorry if I missed any "k". I'm not in my house now, and this keyboard has a crummy k.
Hi All!
I've got a streaming MP3 from a folder on the site to load on PLAY/STOP buttons, and volume slide okay, but I need it to AUTO PLAY when on a frame of the movie. It's about 2mb.
(just so when you get into the site the background music plays auomatically, then the user can adjust volume or stop if they need to)
Any ideas?
(Here's my actionscript) How can I add to this script to auto play the file as well? -
var mySound:Sound = new Sound();
-
mySound.loadSound("mySound.mp3", true);
-
mySound.stop();
-
btnStop.onRelease = function():Void {
-
mySound.stop();
-
};
-
btnPlay.onRelease = function():Void {
-
mySound.start();
-
};
-
var nVolCheck:Number;
-
mcVolSlider.volBall.onPress = function():Void {
-
this.startDrag(false, 0, 0, 400, 0);
-
nVolCheck = setInterval(updateVolume, 100);
-
};
-
mcVolSlider.volBall.onRelease = function():Void {
-
this.stopDrag();
-
clearInterval(nVolCheck);
-
};
-
function updateVolume():Void {
-
var vol:Number = (mcVolSlider.volBall._x)/4;
-
mySound.setVolume(vol);
-
mcVolSlider.volBall.volText.text = vol;
-
}
-
any ideas at all would be helpful!
Thanks in advance guys!
=)
Hiya The_Nephilim!!
Your "k's" are just fine! As so is the code! :)
Definitely background music, I placed this in after the load.sound function... and it worked perfectly!
Thanks heaps and as always very helpful!
=)
Hi, elamberdor!
The script that you posted is for the background music, isn't it?
If you want the code to start playing as soon as it finished loading you can do it but setting the start method inside it's onload. Like this: -
mySound.onLoad = function(success) {
-
if(success) {
-
this.start();
-
}
-
}
-
You're welcome!
Glad you got it to work now.
Best regards,
The_Nephilim
Hiya The_Nephilim!!
Your "k's" are just fine! As so is the code! :)
Definitely background music, I placed this in after the load.sound function... and it worked perfectly!
Thanks heaps and as always very helpful!
=)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Manlio Perillo |
last post by:
Hi.
This post follows "does python have useless destructors".
I'm not an expert, so I hope what I will write is meaningfull and
clear.
Actually in Python there is no possibility to write code that follows
C++ RAII pattern.
Of course Python objects are not statics like in C++, but in C++ the
auto_ptr class is used for enforcing this pattern for dynamical
|
by: Uma Vivek |
last post by:
Hi,
I have a problem with Flash remoting via .NET . I seem to have all the
code right, but flash does not seem to display the data at all.
Here's is what Ive done so far...
(1) Ive installed Flash Remoting MX, and copied over the contents of
wwwroot\flashremoting\bin into my web application's folder\bin.
|
by: Mike |
last post by:
I have a simple flash file that plays within a webform of an asp.net app.
When running from the server the flash file works fine. But when I run it
from my localhost the flash file simply doesn't play. I have Flash installed
on my localhost, and I'm not sure why its not working.
Is there a setting somewhere in IIS or the computer's Extensions of my
localhost which may be preventing it from playing?
Before posting my code which...
|
by: JJ |
last post by:
Although this question involves Flash, I suspect the actual issue is an asp
one..
I am trying to open the web.sitemap file in an .swf file enbedded in an asp
page (I'm working in VS 2005).
I get an error in Flash when it trys to open this file using standard Flash
commands. However when I change the file name and command to 'Web.xml'
it works. (it also works if I don't change the name, but run the swf in
flash player and not via the...
|
by: gescom |
last post by:
I'm trying to build an image gallery in Flash that extracts data from two external XML files using Actionscript. Currently I have one fully functional gallery that I'm satisfied with and would basically like to duplicate it in design, but use another XML file for the images, and have both galleries in the same scene. The tricky part is that I would like the second XML to essentially react to the first XML. For instance, if an image is...
| |
by: Neo Geshel |
last post by:
Greetings.
BACKGROUND:
My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are
delivered as application/xhtml+xml for all non-MS web clients, and as
text/xml for all MS web clients (Internet Explorer).
My flash content was originally brought in via the “flash satay” method,
but I have since used some server-side magic do deliver one <objecttag
|
by: ramvenkat |
last post by:
hi
is it possible to save a external file through flash application in a particular folder specified in the flash application?
means
1)would like to specify a folder while saving a particular external file through flash
2)need to take the saved file again through the same flash file..
|
by: AutumnsDecay |
last post by:
Hey.
New problem. Ugh...
As it turns out Flash will not load an XML file located elsewhere (some other websites, network, etc..). It will only load local XML. This causes a problem for me.
My code requires external XML as it is generated by a weather service.
Is there a way (using AS2) to allow for loading of external XML instead of having it hosted locally?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |