Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Adding Sound To Listbox On Rollover?



Hello,
Is it possible to have a sound triggered when you rollover listbox menu items? Either with an action or by editing the box itself perhaps? I'm using Flash MX

Thanks!
Jason



FlashKit > Flash Help > Flash ActionScript
Posted on: 03-09-2006, 11:22 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Adding A Rollover Sound?
I just need to add a rollover sound to a movie, i dont have a clue. How do you do that and does it matter what frame the sound starts on? Thanks, im clueless

Adding To Listbox Dynamically
Hi, i am trying to add items to a list box dynamically. I am using PHP to post variables to flash. The output is like this :-

total=3&name1=jules&name2=harry&name3=phil&

I am trying make a loop that adds the varibles of name1, name2 ect until it reaches the total. When i try to do this it just enters name1, name2 and name3 into the listbox not the actual names? It works if add it like :

List.addItem(name1); The adds the item 'jules' to the listbox.

But wont work if i add it like :

x = 1;
List.addItem("name" add x);

It just adds 'name1' to the listbox?

Very wierd and frustrating! If anyone can help with the 3 lines of code that is needed to make the loop and add the items i would very grateful as i have tried everything!!!

Many thanks in advance.

Jules
Jules@hungrybear.co.uk

Adding Item To A ListBox
Hi,
i am tring to add items to a list box and it gets added shows everything in reverse order. what i mean is , if i add image1,image2,....image10, it lists image10,image9,....image1. How do I solve this? Any help appreciated. Thanks in advance.
Nesamani.E

Help - Listbox Rollover
Hello,
How can I add a rollover command for a listbox to where it will trigger a sound when rolling over each menu item? I figured out how to make it work when rolling over the whole menu, but that's not too good. Is there a way for each choice to trigger a sound on rollover? Here's my current code:

list.addItem("Choice 1", 5);items.setChangeHandler("myHandler");
function myHandler() {
gotoAndStop(list.getSelectedItem().data);
}

And that works good for sending you to another frame depending on what you've clicked. But what about on rollover? Right now the menu doesn't do anything when you rollover -- only when you click.

Thanks!
Jason

UI ListBox On RollOver
Any ideas on how to execute a function specific to the contents of an item in a ListBox on RollOver while maintining the Event Handler click functionality.

Basically, I want to call a function when a user rolls over a ListBox item (eg displays the contents of the rolled-over item in a field) and call a function when a user clicks on an item as well.

Seems easy. What am I missing? The answer is worth one American dollar.

Listbox Rollover Colour?
does any one know how to highlight an item in a listbox when you rollover it. I can only seem to highlight an item when you click on it.

is there a code something like this:

listbox.setStyleProperty("rollover", 0xCC0000);

any help would be great.

[F8] Adding Items To A Listbox Embedded In A Movieclip
Hi all,

The movie clip I'm attaching has a text field (called module) and a listbox (called issuesBox) in it.
On stage I have a button with the following code:


Code:
on(click){
for (i=0;i<=5;i++) {
var newClip:MovieClip = _root.attachMovie("mc", "mc"+i, i,{_x:50,_y:yval});
newClip.module.text="title";
for (j=0;j<=10;j++) {
newClip.issuesBox.addItem("hi");
}
}
}
At runtime I get 5 movie clips with the text field filled with "title," like I hoped for. However, the listbox isn't getting filled 10 times like I thought it would. Any suggestions?

Thanks!

Rollover State In Listbox Component
Hi

can any help me. I want to get the listBox component
to do rollovers, and then onPress launch the change
handler.

Been fidding around for many hours, and I`m slowly loosing
the will to live


cheers in advance

mike

Adding Horizontal Scroll Functionality To ListBox Component
how can i add a horizontall scroll bar to ListBox Component, so that when the item width is greater than the original width of the ListBox, the ListBox show a horizontal scroll at bottom.

I came to know that i can extend the class to provide this functionality but dont know the code to do it.
any body knows this how to do it please.

Xml-sound-listbox Issues
I get this error when I select an item in my listBox:

PHP Code:



Error opening URL "file:///C|/Documents%20and%20Settings/adam/Desktop/Working%20file%20browse%20%2B%20xml/undefined" 




that url is the location of my swf file and xml doc, but not the location of my songs, which are defined in the xml doc, which looks like this:

PHP Code:



<song><songName>Dave Brubek - Take Five.mp3</songName><songLocation>C:Documents and SettingsadamMy DocumentsMy MusicDave Brubek - Take Five.mp3</songLocation></song> 




this is what I have in actionscript:

PHP Code:



function getPlaylist() {var playlist:XML = new XML();playlist.ignoreWhite = true;playlist.load("playlist2.xml");playlist.onLoad = function() {//trace("Loaded");var baseNode = this.childNodes;var sLabel, sData;for (i=0; i<baseNode.length; i++) {sLabel = baseNode[i].firstChild.firstChild.nodeValue;sData = baseNode[i].firstChild.nextSibling.firstChild.nodeValue;//trace(baseNode[i].firstChild.nextSibling.firstChild.nodeValue);//songlist_lb.addItem({label: sLabel, data: sData});songlist_lb.addItem({label:sData,data:sLabel});}}} myselection = new Object();myselection.change = function(ListEvent){volume = 100;var theSong = songList_lb.getSelectedItem().data;mySongs = new Sound ();mySongs.loadSound (theSong, true);mySongs.setVolume (volume);}songlist_lb.addEventListener("change",myselection); 




Any idea's why this is happening ?? Im clueless as to why Im getting this error....

Playing A Sound Via Listbox...
I've been having some trouble with the coding on this, I know I'm doing a little thing wrong with thsi but I can't figure it out. I want it to play a song (from a URL) by selecting it in a listbox.

I made a listbox and named it "songs"


Code:
//randomize
x = Math.round((Math.random()) * 4)
songs.setSelectedIndex(x);

music = new Sound(this);
y = getSelectedIndex();
if(y==0){
songurl="http://www.haxorl33t.com/mp3/trust.mp3";
}
if(y==1){
songurl="http://www.haxorl33t.com/mp3/glory.mp3";
}
if(y==2){
songurl="http://www.haxorl33t.com/mp3/risen.mp3";
}
if(y==3){
songurl="http://www.haxorl33t.com/mp3/rules.mp3";
}
if(y==4){
songurl="http://www.haxorl33t.com/mp3/waste.mp3";
}
music.loadSound(songurl,true);
any help is much appreciated, thanks..

Xml-sound-listbox Issues
I get this error when I select an item in my listBox:

PHP Code:



Error opening URL "file:///C|/Documents%20and%20Settings/adam/Desktop/Working%20file%20browse%20%2B%20xml/undefined" 




that url is the location of my swf file and xml doc, but not the location of my songs, which are defined in the xml doc, which looks like this:

PHP Code:



<song><songName>Dave Brubek - Take Five.mp3</songName><songLocation>C:Documents and SettingsadamMy DocumentsMy MusicDave Brubek - Take Five.mp3</songLocation></song> 




this is what I have in actionscript:

PHP Code:



function getPlaylist() {var playlist:XML = new XML();playlist.ignoreWhite = true;playlist.load("playlist2.xml");playlist.onLoad = function() {//trace("Loaded");var baseNode = this.childNodes;var sLabel, sData;for (i=0; i<baseNode.length; i++) {sLabel = baseNode[i].firstChild.firstChild.nodeValue;sData = baseNode[i].firstChild.nextSibling.firstChild.nodeValue;//trace(baseNode[i].firstChild.nextSibling.firstChild.nodeValue);//songlist_lb.addItem({label: sLabel, data: sData});songlist_lb.addItem({label:sData,data:sLabel});}}} myselection = new Object();myselection.change = function(ListEvent){volume = 100;var theSong = songList_lb.getSelectedItem().data;mySongs = new Sound ();mySongs.loadSound (theSong, true);mySongs.setVolume (volume);}songlist_lb.addEventListener("change",myselection); 




Any idea's why this is happening ?? Im clueless as to why Im getting this error....

Playing A Sound Via Listbox...
I've been having some trouble with the coding on this, I know I'm doing a little thing wrong with thsi but I can't figure it out. I want it to play a song (from a URL) by selecting it in a listbox.

I made a listbox and named it "songs"


Code:
//randomize
x = Math.round((Math.random()) * 4)
songs.setSelectedIndex(x);

music = new Sound(this);
y = getSelectedIndex();
if(y==0){
songurl="http://www.haxorl33t.com/mp3/trust.mp3";
}
if(y==1){
songurl="http://www.haxorl33t.com/mp3/glory.mp3";
}
if(y==2){
songurl="http://www.haxorl33t.com/mp3/risen.mp3";
}
if(y==3){
songurl="http://www.haxorl33t.com/mp3/rules.mp3";
}
if(y==4){
songurl="http://www.haxorl33t.com/mp3/waste.mp3";
}
music.loadSound(songurl,true);
any help is much appreciated, thanks..

Adding Sound Buttons, Cutting Off Prev Sound
Hi - I want to add a few audio narration clips via buttons to this page, inside each section:

http://www.chartscans.com/csalerts.swf


When the movie starts, it autoplays a bg music + narration nonlooped single track.

How can I add say a button that loads/plays an external mp3 And also shuts off the first sound that had started?

any ideas?



thx flash dudes..

Adding URL In Animated Rollover..
Hi guys,, I have been stuck on the past hour on getting this to work.
What I need to create is something like this:

http://www.kzok.com/

If you click over the artists on the header you will see it pop up with a screen and url once you click on it.

So far I have only managed to be alble to do the animation on the rollovers,but can't figure out how to get a url to load without it screwing up the animation or even working...help!

Problem With Adding Url Interfering With Rollover
i have flash 8


Okay to start with I'm not a flash programmer but this guy left me in a lurch and I had to add the url's to the links myself, the problem is that it messes up the rollover action.

Here is the original: http://www.cecvp.com/header5.swf

Here is the version with the urls put on the links: http://www.cecvp.com/header5_mod.swf

There are other things I changed but ignore that, just focus on the behavious of the navigation links (home, about us, etc). In the second version the rollover stopped working.


The process i used to add the url was to double click until i got to symbol 18 at which point i would double click on each link the select it then enter the url where the link symbol is in the properties window. It should also be noted that i got this error when publishing:


Code:
**Error** Symbol=Symbol 18, layer=Layer 1, frame=1:Line 1: Wrong number of parameters; getURL requires between 1 and 3.
getURL();

Total ActionScript Errors: 1 Reported Errors: 1

[CS3] Adding Delay To Content Rollover In CS3
Hello all!
I am creating a site with rollovers showing content rather than pages. I would like to add a two second delay on these rollovers. My guess is to use setInterval since the functions will be fired many times, but still confused on how to integrate it into my existing code (which btw, is by big help from FK people! thanks!!!) Any help greatly appreciated!


Code:
MovieClip.prototype.moveXYR = function(xValue, yValue, hValue, wValue) {
this.onEnterFrame = function() {
var v5 = xValue-this._x;
this._x += v5*0.3;
var v3 = yValue-this._y;
this._y += v3*0.3;
var v4 = hValue-this._height;
this._height += v4*0.3;
var v2 = wValue-this._width;
this._width += v2*0.3;
if (Math.abs(v3)<0.3 && Math.abs(v5)<0.3 && Math.abs(v4)<0.3 && Math.abs(v2)<0.3) {
this.onEnterFrame = null;
}
};
};
MovieClip.prototype.moveXY = function(xValue, yValue) {
this.onEnterFrame = function() {
var v3 = xValue-this._x;
this._x += v3*0.15;
var v2 = yValue-this._y;
this._y += v2*0.15;
if (Math.abs(v2)<0.15 && Math.abs(v3)<0.15) {
this.onEnterFrame = null;
}
};
};
this.box1.moveXYR(37, 125, 230, 590);
this.box2.moveXYR(37, 365, 80, 590);
this.box3.moveXYR(37, 455, 80, 590);
this.box4.moveXYR(37, 545, 80, 590);
this.content2.moveXYR(50, 380);
this.content3.moveXYR(50, 470);
this.content4.moveXYR(50, 560);
unloadMovieNum(3);


content1.hit.onRollOver = function() {
box1.moveXYR(37, 125, 230, 590);
box2.moveXYR(37, 365, 80, 590);
box3.moveXYR(37, 455, 80, 590);
box4.moveXYR(37, 545, 80, 590);
content1.moveXYR(50, 140);
content2.moveXYR(50, 380);
content3.moveXYR(50, 470);
content4.moveXYR(50, 560);
};
content2.hit.onRollOver = function() {
box1.moveXYR(37, 125, 80, 590);
box2.moveXYR(37, 215, 230, 590);
box3.moveXYR(37, 455, 80, 590);
box4.moveXYR(37, 545, 80, 590);
content1.moveXYR(50, 140);
content2.moveXYR(50, 230);
content3.moveXYR(50, 470);
content4.moveXYR(50, 560);
};
content3.hit.onRollOver = function() {
box1.moveXYR(37, 125, 80, 590);
box2.moveXYR(37, 215, 80, 590);
box3.moveXYR(37, 305, 230, 590);
box4.moveXYR(37, 545, 80, 590);
content1.moveXYR(50, 140);
content2.moveXYR(50, 230);
content3.moveXYR(50, 320);
content4.moveXYR(50, 560);
};
content4.hit.onRollOver = function() {
box1.moveXYR(37, 125, 80, 590);
box2.moveXYR(37, 215, 80, 590);
box3.moveXYR(37, 305, 80, 590);
box4.moveXYR(37, 395, 230, 590);
content1.moveXYR(50, 140);
content2.moveXYR(50, 230);
content3.moveXYR(50, 320);
content4.moveXYR(50, 410);
};

Adding A Rollover State To A Movieclip
I have a flash piece with a number of shapes/text that are movieclips, that take you to various sections when clicked. I'd like the text to change color when you roll-over them.

I know you can do this with buttons but I've already done a lot of work and they're movieclips. Can I do that?

Adding Rollover Buttons To Web Pages
what is the syntax for adding a rollover button as an image button in an .aspx page?  I have saved the button as a .swf file and put it as the ImageUrl, but since it isn't an image, do I need to save it as an image in flash rather than a button?

Cheers,

Mike


Listbox /combobox Help, Linking Combo And Listbox To Call Url W/ Flash 7
Seeking:
I'm want to be able to select an item from a combobox, that will call a list into a listbox, and then be able to click on that link to navigate to a URL.

Purpose:
I have a list of over 80 blog urls from the past several year, a monthly release. I would like to be able to select the year in a combobox which will trigger the 12 url from that year to appear in a listbox, when an item from the listbox is selected I want that url to open. This has proved to be quite difficult in in Flash 7. Any assistance, link, or tutorials would be greatly appreciated.

Adding A Rollover State To Component Scrollbar (MX)
I was wondering how easy it is to add a rollover state to the arrows and scrollbar in MX's scrollbar component. None of the ways I've tried have worked. It seems I have to register a new state?? Or is it something else?

Adding And Order To An Action Of An Advanced Rollover...
Hi,

Influenced by this tutorial, I have some questions...

Is there a way to make it so that, for example, the first rollover+rollout plays frames 2-6+7-10 and then, with the same button, the second rollover+rollout plays frames 11-15+16-19 of a movie clip?

the frame numbers are of course arbitrary but I need help with the actionscript of a way to go about this.

thanks for your time

Adding A Complex Rollover To The Transitions Tutorial
Iv been using the following tutorial http://www.kirupa.com/developer/mx2004/transitions.htm to have in and out transitions for my external pages. No problem there, helpful tutorial and everythings loading and unloading fine.

Problem is I want to attach a nice complex rollover to the over state of the buttons. But When i do this it disables the action of both the button (it refuses to load anything) and prevents the rollover (which now just blinks in an erratic manner). They only work when not on top of one another... if the rollover is positioned outside of the hit area of the button. Obviously though i want the rollover effect to take place within the area of the button.

Is there any way around this? If that made any sense at all of course.

Simply Adding A Hand Cursor On RollOver ?
What is the simplest way to make an item show the hand cursor on Roll Over ? I wish it was as simple as this:
item.useHandCursor = true;
or
item.buttonMode = true;

Is there something obvious that I'm looking over?
I'm sure I'm not the only one wondering this.

Thanks in advance!
-HaunGo

Rollover W/sound , Stop Sound On Rollout
HI,

I've got rollovers w/sound, that are close to each other. When i roll over them, they ALL play...How do I stop sound on rollout WITHOUT stopping my Background sounds?

Help Appreciated, Thx

Rollover Sound On - Rolver Sound Stop
I am new to Flash but would like a little more control over a button sound than I currently understand. I would like a sound to play on rollover of a button but as soon as the mouse is outside that button, I would like the sound to stop. Is there an easy way to achieve this?

Thanks

Load Swf File From ListBox, When Close Swf ListBox Disappear
Hello all,

I seemed to have problems with Listbox for days now. I managed to write actionscript to load external swf file when selecting a choice from the listbox. However, when the close the swf file by writing the script 'unloadmovie'. It returns to the main scene however, the problem is the ListBox disappears!... anyone advice me please what I did wrong

Thank you very much
Any help appreciated.

Peddie

Uble Adding Additional Animation To An Existing Rollover Movie Clip.
Hey all,

I'm using Flash 8. I have a picture of a building which is segmented into floors. Upon rolling over a grouping of floors the user sees either a blue overlay, indicating they can click, or a gray overlay simply describing what the floor is. I already have some actionscript in place and I don't need to alter it, I just added more animation to an existing movieclip rollover, but it's not quite working. On one of the floors that rolls-over gray, I want an additional rollover with some text. So I made a movie clip of the rollover animating out and the type coming in and I just added it to the gray fade in movie clip since there was already onRollover actionscript in place there. However, the rollover kept playing over and over again. So, of course I added a Stop action. Then, the animation didn't work anymore, it just rolled over to the final state of that animation. Does anyone have any ideas of what I can do, or what I can do as an alternative? I'll post the actionscript in case that helps. Like I said, the rollover "rolls-over" but either loops (without a Stop action), or rolls over to the final frame in the animation (with a Stop action).

Thanks!
Mc

Adding Sound
can anybody show me how to start a sound file when i click on a button, and stop the sound when i click on another.(play button and stop button)

Adding Sound
hey ya'll,

I'm working on a flash movie and when mario jumps I want it to make a sound. I import and it's now in my library. when mario jumps I want it to make a sound. can any of you help?

Adding Sound
How do you add sound with option of turning it off and on, selecting from tracks and making it play when the page loads?

Adding Sound
...hey ppl
im making a movie in flash and im gonna put it onto a site 4 fun =) and i was just wondering....what is better to do...add the loop directly into your movie or get the intro onto the site and just stream the loop onto the site...or am i wrong bout the streaming stuff?? :S ..im confuzzled ya well thanks in advance
jackie

Adding Sound
I want to have sounds triggered by clicking numbers 1 2 3 off. I figured out the off one with a little bit of action script. But when I add the other ones it plays from the begining. I also want the sound to play and loop all the way through. Thanks for the help!!!

heres the link http://www.riprocksclub.com/main.php The songs are in the top right corner.

Thanks!!

Adding Sound
Hi,

I have two movie clips , say for example MC1 and MC2.

whenever MC1 colide with or touches the MC2 i need to play a sound .

please help me out, if u have any tutorials or any link to tutorials will do.

Thanks & Regards
Zab

Adding Sound
How do i loop a sound clip to play continously in the background without stopping.

Pls help me

Adding Sound
Hey there,

Well I've workT with flash before but never did I have
to add sound. I know how to add sound and wot not but
the problem is that I dont know how to sync the sound
with a frame withou it looping and not following the frame.
See wot Im doing is a count down. When the number shows 7
you would here a "beep" then after that 6 then "beep" and
so on and so on. But when I do it the sound doesnt match up
to each frame when a number is shown....get me? If you dont
lemme know. If you do.....please help!
ThanX

Adding Sound
I'm trying to add an mp3 sound file to a layer and would like the layer to expand to fit the file. Is there an easy way to do this?

Adding Sound
hey, i just want to add a looping sound to my website. I have gone through the help files but havent been so sucessful Anyone give me step-by-step instructions just for a simple background sound to keep looping? Plzzz help,

Thanks Lopster

Adding Sound
hy,

how can you add a sound so that when you rollover a button you hear it?

Greetz
tnx in adv

Help Adding Sound
Hi!
I'm trying to construct a Flash Animation Movie.... but when the "snow effect" starts, the background music stops. Can anyone point me in the right direction?
I am using: http://www.flashkit.com/movies/Anima...2743/index.php

Adding Sound
How do I put a soundfx into my flash moive and how do I sort out the timing and things like that. Im a newbi and I dont know how to do it.
Thanx alot

Adding Sound Using FX To A FLa
hello everyone...i am new to this flash....(yup i can hear the s******s from here..hahahaha)
and way how do i add sound to a FLa, have tried importing to stage, but how do i get it to stop and start? any help would be mighty apreciated.

thanks

Adding A Sound
Hi folks,
I've just finished building a video conferencing facility using the Influxis FloTools components. The app is on this page while I build the rest of the web site.

However, my query is this. I would like to keep my web page open while I work and for the app to notify me when someone visits my site by playing a sound that is heard by everyone on the site. The reason for this is that I don't have my AV feed running constantly due to the high bandwidth useage, I'd only start the feed when I have a visitor.

I'm just unsure where the AS should go to support this and would like some assistance.

Thanks in advance,
Steven

Adding Sound FX
How do I add a sound effect to a flash document? Please help me by explaining all the steps, from downloading off flashkit to puting into flash and using it, and what to look for if I have to give credit to someone. Thanks.

Also what format does the sound fx have to be in for it to be used in a flash document? .wav? .mp3? Thanks

Adding Sound
I am new to flash so don't laugh.
I have made a sort of flash intro and it has two scenes.
The first scene has sound in it and it works fine,however when the second scene comes on i don't seem to have any control over where the sound starts.i.e,i want a beep halfway through the scene but it just plays the beep as soon as the second scene loads.
Its driving me crazy so please help.
Thanks
Bunkerboy

Help Adding Sound To An Mc
hello,

well i did search for this before posting this but it did not solve my problem even though i tried each and every one of them.

here is tutorial that i did
Tutorial
for the animated button.

now i wanna add a sound to this button for mouseover

i would be glad if someone can tell me exactly what do i need to do in oder to get it working?!
please be precise on where to add the code, coz i generally get that wrong

thank you for your time

Adding Sound
Hi guys,

I add sound with is 43sec long and I only want it to play once but it keeps repeating. I've set the repeat to 0 yet it still keeps playing. How can I fix this?

[F8] Adding Sound
HI, I"m practically new to flash.
I tried adding a song to my library to add it to my small intro i created but it says that the program has trouble reading the song file. What can I do to fix this? is there something i need to adjust in the preferences of my program? I tried adding the file as an .mp3, in the help files with the program they say that we can add .mp3's but yet it doesn't work, also i converted the song into a .wav file and the library could not read it either. help? lol

Copyright © 2005-08 www.BigResource.com, All rights reserved