Dependent ListBoxes Problem
Hi, here is my problem. I have two listboxes and want to "connect" them: by selecting something in the first listbox, specific options should appear in the second that change according to the selection in the first listbox.
Any suggestions please? (or actionscript code or techniques?)
Thanks
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 05-02-2005, 02:45 PM
View Complete Forum Thread with Replies
Sponsored Links:
Dependent ListBoxes Problem
Hi, here is my problem. I have two listboxes and want to "connect" them: by selecting something in the first listbox, specific options should appear in the second that change according to the selection in the first listbox.
Any suggestions please? (or actionscript code or techniques?)
Thanks
View Replies !
View Related
XML And Listboxes
Hi,
I've got 3 list boxes that are populated with XML. They are meant to function where you click on the first one and based on your selection certain information is loaded into the 2nd one. And so on with the 3rd one.
I'm so close to getting this to work but have a few bugs that I can't figure out. The first and second boxes work fine but getting the info to the 3rd box isn't working so well.
Here's my AS:
Code:
var RootNode:XMLNode;
var selectedCategory:String; // formerly selectedGallery
var selectedCompany:String;
var categoryPosition:Number; // formerly photoPosition
var companyPosition:Number;
var CategoryNode:XMLNode; // formerly GalleryNode
//var OptionNode:XMLNode; // formerly PhotoNode
var CompanyNode:XMLNode;
var searchXML:XML = new XML();
searchXML.ignoreWhite = true;
searchXML.onLoad=loadSearch;
searchXML.load("searchBoxes.xml");
stop();
var CBOListener:Object = new Object();
CBOListener.change = loadGallery;
search_lb.addEventListener("change", CBOListener);
var SelectionListener:Object = new Object();
SelectionListener.change = loadCompany;
selection_lb.addEventListener("change", SelectionListener);
// the below function calls the loadCombo function after successfully
// loading the XML file
function loadSearch(success:Boolean):Void{
if (success) {
RootNode = this.firstChild;
loadCombo();
}
else {
trace("Error in loading XML file");
}
}
function loadGallery(evtObj:Object):Void {
var galleryName:String;
if (evt.Obj.target.selectedItem.label !="-- Search by--") {
selectedCategory = evtObj.target.selectedItem.label;
for (var i:Number=0; i< RootNode.childNodes.length; i++) {
galleryName = RootNode.childNodes[i].attributes.categoryName;
if (galleryName == selectedCategory) {
CategoryNode = RootNode.childNodes[i];
categoryPosition = 0;
loadPhoto(categoryPosition);
break;
}
}
}
}
function loadCompany(evtObj:Object):Void {
//trace (evtObj.target.selectedItem.label);
var selectionName:String;
if (evt.Obj.target.selectedItem.label !="-- Choose One--") {
selectedCategory = evtObj.target.selectedItem.label;
for (var i:Number=0; i< RootNode.childNodes.length; i++) {
selectionName = RootNode.firstChild.childNodes[i].attributes.optionname;
if (selectionName == selectedCategory) {
CompanyNode = RootNode.firstChild.childNodes[i];
categoryPosition = 0;
loadSelection(categoryPosition);
break;
}
}
}
}
function loadCombo():Void {
var galleryName:String;
search_lb.addItem("-- Search by--");
for (var i:Number=0; i< RootNode.childNodes.length; i++) {
galleryName = RootNode.childNodes[i].attributes.categoryName;
search_lb.addItem(galleryName);
}
}
function loadPhoto(nodePos:Number):Void {
var galleryName:String;
selection_lb.addItem("-- Choose One--");
for (var i:Number=0; i< CategoryNode.childNodes.length; i++) {
galleryName = CategoryNode.childNodes[i].attributes.optionname;
selection_lb.addItem(galleryName);
}
}
function loadSelection():Void {
var selectionName:String;
company_lb.addItem("-- Choose Company--");
for (var i:Number=0; i< RootNode.firstChild.firstChild.childNodes.length; i++) {
selectionName = RootNode.firstChild.firstChild.childNodes[i].attributes.optionname;
company_lb.addItem(selectionName);
}
}
And a snippet of my XML:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<searchList>
<category categoryName="Name">
<firstOption optionname="A - D">
<secondOption optionname="AT&T">
</secondOption>
<secondOption optionname="Brown">
</secondOption>
<secondOption optionname="Darcy">
</secondOption>
<secondOption optionname="Dilbert">
</secondOption>
</firstOption>
<firstOption optionname="E - J">
<secondOption optionname="Evans">
</secondOption>
<secondOption optionname="Green">
</secondOption>
<secondOption optionname="Jackson">
</secondOption>
</firstOption>
Can someone please lend a hand? Click the link below to look at the files if that will help. Please?
http://www.clevercircles.com/boxes.zip
View Replies !
View Related
Listboxes And LoadMovie
I'm quite new to Flash, and was wondering if it was possible to set up a listbox in such a way that the entries, when clicked, unload one movie and load another in its place.
I understand that I would need to use unloadMovieNum and loadMovieNum.
I know how to do it with buttons, using
on (release) {
unloadMovieNum(1);
loadMovieNum("pic2.swf", 1);
}
but hopefully the listbox will have 1-200 entries, which would be utterly impractical for buttons.
On a side note, how hard would it be to have a search box to search the listbox contents and make finding things easier?
Any help would be greatly and humbly appreciated.
Thanks
Scott
View Replies !
View Related
DuplicateMovieClip And Listboxes
Hi all!
I have a movie clip containing a list box. I need to be able to duplicate this clip several times and still be able to get to the list box instance inside, but for some reason I cant' get to it.
Any suggestions?
Thanks!
-Dan
View Replies !
View Related
Difference In Listboxes?
I tried to insert a listbox used in a older .fla I had.
It actually works, but is it a listbox from Flash 6.
But the list taken from the UI components in FLASH 2004 don't work.
Is there a difference between those two? I noticed that copying the old listbox gives me a lot of actions-files, but the new listbox don't have that.
Take at the picture I attached. It shows the two listboxes. One files and one not!
Right: flash 6 listbox
Left: flash MX2004 (UI Component) listbox
View Replies !
View Related
Set Focus & Listboxes
Hi All,
Just so you all know this is my first post, and my first venture into the world of actionscript. I have worked extensively with VB6, but very little with scripting languages, so if I ask a stupid question, go easy!
OK, I have a project that has 3 layers, one for code, one for the navigation buttons and one for the content of the movie.
The content of the movie consists of 2 listboxes and 2 movie clips. The listboxes have the name of files listed in them, when the user clicks a file it loads the relevant .swf into the appropriate movie clip, that all works fine.
The problem I have is that when the movie loads listbox1 has the focus, and I can happily select any of the files in that listbox with one click, but when I try to select a file from the second list box I have to click twice to get it to load. The first click swaps the focus from list box 1 and the second click selects the file.
The same is true of the navigation buttons at the top, if I have previously been selecting files from the list boxes, in order to navigate to another frame of the movie I have to click once on the button to swap the focus and then once to select the button I want.
I found some examples using the setfocus function, and tried to adapt it for my list box:-
list.onRollOver = function() {
Selection.setFocus("list");
trace(_global.focuscounter);
}
So if I leave out the Selection.setFocus("list");, then Flash dumps a 0 every time my mouse rolls over the box (as expected). As soon as the other line is added I receive a message that a script in my movie may be making it run slowly, and "Do you want to stop the script". When I choose yes it shows the trace window with 20 or 30 zero's in it, so I seem to be generating an infinite loop.
So basically, how do I enable the user to select either a file from the listbox or a navigation button without them having to click once to swap the selection, and then once to pick the file/button.
Cheers
View Replies !
View Related
Setfocus & Listboxes
Hi All,
Just so you all know this is my first post, and my first venture into the world of actionscript. I have worked extensively with VB6, but very little with scripting languages, so if I ask a stupid question, go easy!
OK, I have a project that has 3 layers, one for code, one for the navigation buttons and one for the content of the movie.
The content of the movie consists of 2 listboxes and 2 movie clips. The listboxes have the name of files listed in them, when the user clicks a file it loads the relevant .swf into the appropriate movie clip, that all works fine.
The problem I have is that when the movie loads listbox1 has the focus, and I can happily select any of the files in that listbox with one click, but when I try to select a file from the second list box I have to click twice to get it to load. The first click swaps the focus from list box 1 and the second click selects the file.
The same is true of the navigation buttons at the top, if I have previously been selecting files from the list boxes, in order to navigate to another frame of the movie I have to click once on the button to swap the focus and then once to select the button I want.
I found some examples using the setfocus function, and tried to adapt it for my list box:-
list.onRollOver = function() {
Selection.setFocus("list");
trace(_global.focuscounter);
}
So if I leave out the Selection.setFocus("list");, then Flash dumps a 0 every time my mouse rolls over the box (as expected). As soon as the other line is added I receive a message that a script in my movie may be making it run slowly, and "Do you want to stop the script". When I choose yes it shows the trace window with 20 or 30 zero's in it, so I seem to be generating an infinite loop.
So basically, how do I enable the user to select either a file from the listbox or a navigation button without them having to click once to swap the selection, and then once to pick the file/button.
Cheers
View Replies !
View Related
1 Xml File, 2 Listboxes
I recently set up a video player based on the tutorial form Lisa Larson-Kelley on building an XML playlist, which I was successful at getting to work. I wanted to take this to the next step of creating either a second listbok or buttons for catagories from which only videos within the catagory would display in the listbox or title list. I have seen information on AS2 solutions but not for AS3. I have ne XML file that I modified to include a catagory tag which I have been able to parse out the catagory names into a listbox, but am stuck on sending the selected catagory data to a second ttilist. I am using the following approach to target the second box:
toplist.addEventListener(Event.CHANGE, itemChange);
function itemChange(e:Event):void {
blist= toplist.selectedItem.data;
In tests, clicking on the toplist catagory returns the errror
TypeError: Error #1034: Type Coercion failed: cannot convert XML@43c0b081 attribute CISCO (the catagory name) to fl.controls.TileList.
If a thread for this exists, or you have some helpful suggestions, please and thanks.
View Replies !
View Related
Set Focus & Listboxes
Hi All,
Just so you all know this is my first post, and my first venture into the world of actionscript. I have worked extensively with VB6, but very little with scripting languages, so if I ask a stupid question, go easy!
OK, I have a project that has 3 layers, one for code, one for the navigation buttons and one for the content of the movie.
The content of the movie consists of 2 listboxes and 2 movie clips. The listboxes have the name of files listed in them, when the user clicks a file it loads the relevant .swf into the appropriate movie clip, that all works fine.
The problem I have is that when the movie loads listbox1 has the focus, and I can happily select any of the files in that listbox with one click, but when I try to select a file from the second list box I have to click twice to get it to load. The first click swaps the focus from list box 1 and the second click selects the file.
The same is true of the navigation buttons at the top, if I have previously been selecting files from the list boxes, in order to navigate to another frame of the movie I have to click once on the button to swap the focus and then once to select the button I want.
I found some examples using the setfocus function, and tried to adapt it for my list box:-
list.onRollOver = function() {
Selection.setFocus("list");
trace(_global.focuscounter);
}
So if I leave out the Selection.setFocus("list");, then Flash dumps a 0 every time my mouse rolls over the box (as expected). As soon as the other line is added I receive a message that a script in my movie may be making it run slowly, and "Do you want to stop the script". When I choose yes it shows the trace window with 20 or 30 zero's in it, so I seem to be generating an infinite loop.
So basically, how do I enable the user to select either a file from the listbox or a navigation button without them having to click once to swap the selection, and then once to pick the file/button.
Cheers
View Replies !
View Related
Images In Listboxes
Hello folks,
Just wondering if anyone out there knows of an easy way to include images in a listbox. Wether I can do it using the listbox component that comes with MX or if I have to do something different (custom) in order to get little images in a listbox along side text etc etc.
View Replies !
View Related
Help With Arrays And ListBoxes
My goal is simple. I have created a listbox and I would like for a person to be able to select an item and have that item sent to their list box while removing it from its current listbox. Basically, I am trying to create a fantasty football draft program (to learn).
Here is where I am struggling:
Code:
//qb list
qlist.addItem("a");
qlist.addItem("b");
qlist.addItem("c");
//How do I get the selected item into another listbox named
//player1list? There will be 12 total selections, so I need to
//know how to add multiple items
Your help is desperately needed but quite appreciated!
View Replies !
View Related
Listboxes... Setting Selected Label?
So, I have this listbox that lists various fonts. When a user selects a font, it naturally changes the font of a text field.
HOWEVER there is a second means of changing the font... when this happens, I would like the listbox's currently selected label to update accordingly. So, if suddenly the text becomes Verdana, the selected item in the listbox reads 'Verdana.'
Is it possible to reset the currently selected item in a listbox?
View Replies !
View Related
Mp3 Player With 3 Listboxes And Category/subcategory
Hi,
I am trying to hack this mp3 player so that it displays 3 levels of hierarchy instead of 2. Check out the current player here http://www.yanwhite.com/staging/GetGoodMusic/music.htm
Currently it has kind of 3 levels, but using 2 buttons for the top level.
I want all 3 as list boxes. So that listbox1 has main categories, listbox2 displays subcategories and listbox3 displays the tracks.
Here is the actionscript..
//setting it up
//change path to your own
path = "http://billwatson2.no-ip.info/public/flash/music/";
loadBB.setLabel("By Mood");
loadB.setLabel("By Genre");
pause.setLabel("Pause");
playB.setLabel("Play");
pause.setEnabled(false);
playB.setEnabled(false);
//constucting menu system
//next few functions just allow 1 listbox to chat to the other
function Labels() {
this.lab = new Array(0);
this.dat = new Array(0);
}
Labels.prototype.addLabel = function(name, value) {
this.lab.push(name);
this.dat.push(value);
};
Labels.prototype.change = function(obj) {
var i;
obj.removeAll();
for (i=0; i<this.dat.length; i++) {
obj.addItem(this.lab[i], this.dat[i]);
}
obj.setScrollPosition(0);
};
FlistBoxClass.prototype.changeLabels = function() {
this.getValue().change(this.sub);
};
FlistBoxClass.prototype.setSubMenu = function(sub, label, x, y) {
label.change(this);
this.sub = sub;
this.setChangeHandler("changeLabels", this);
this.setSubIndex(x, y);
};
FlistBoxClass.prototype.setSubIndex = function(x, y) {
this.setSelectedIndex(x);
this.sub.setSelectedIndex(y);
};
//change what you like here to add your own artists and songs
//just make sure the title of the song is the same as the name of the mp3
//eg for myGreatSong.mp3 add the title as myGreatSong
//the data being added to the listbox is for demonstration only as no use is made of it
menu = new Labels();
menu.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
submenu.addLabel("Telegraph Road", 4);
submenu.addLabel("I Want my MTV", 4);
menu.addLabel("Eagles", submenu=new Labels());
submenu.addLabel("Desperado", 1);
submenu.addLabel("Hotel California - Unplugged", 2);
submenu.addLabel("Lying Eyes", 3);
submenu.addLabel("New Kid In Town", 4);
submenu.addLabel("On the Border - Already Gone", 5);
submenu.addLabel("Take It To The Limit", 6);
submenu.addLabel("Peaceful, Easy Feeling", 7);
submenu.addLabel("Take it Easy", 8);
submenu.addLabel("Tequila Sunrise", 9);
menu.addLabel("The Beatles", submenu=new Labels());
submenu.addLabel("Come Together", 1);
submenu.addLabel("Here Comes the Sun", 2);
submenu.addLabel("Hey Jude", 3);
submenu.addLabel("Lady Madonna", 4);
submenu.addLabel("Lucy In the Sky With Diamonds", 5);
submenu.addLabel("Maxwell's Silver Hammer", 6);
submenu.addLabel("Octopus's Garden", 7);
submenu.addLabel("Revolution 1", 8);
submenu.addLabel("While My Guitar Gently Weeps", 9);
menu.addLabel("Bob Marley", submenu=new Labels());
submenu.addLabel("No Woman No Cry", 1);
submenu.addLabel("Jammin", 2);
submenu.addLabel("Exodus", 3);
menu.addLabel("Bob Dylan", submenu=new Labels());
submenu.addLabel("Like A Rolling Stone", 1);
submenu.addLabel("Mr Tamborine Man", 2);
menu.addLabel("Rolling Stones", submenu=new Labels());
submenu.addLabel("Wild Horses", 2);
menu2 = new Labels();
menu2.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
//formatting buttons and listboxes....change to suit
aformat = new FStyleFormat();
aformat.textSize = 12;
aformat.textColor = 0xffff00;
aformat.textBold = false;
aformat.textUnderline = false;
aformat.textFont = "Arial";
aformat.face = 0x000000;
aformat.arrow = 0xffffff;
aformat.highlight = 0x0000ff;
aformat.highlight3D = 0x0000ff;
aformat.darkshadow = 0x0000ff;
aformat.shadow = 0x0000ff;
aformat.background = 0x123456;
aformat.selection = 0xffffff;
aformat.selectionUnfocused = 0xff0000;
aformat.textSelected = 0x0000ff;
aformat.applyChanges();
aformat.addListener(playB, pause, loadB, loadBB, artists, titles);
//titles list box handler
titles.setChangeHandler("playsongs");
function playsongs() {
s.stop();
delete s;
playB.setEnabled(true);
playB.setLabel("Play");
pause.setLabel("Pause");
pause.setEnabled(false);
loadB.setEnabled(true);
loadB2.setEnabled(true);
loaded = true;
paused = false;
}
//code for buttons
loadB.onRelease = function() {
artists.setSubMenu(titles, menu, 0, 0);
};
loadBB.onRelease = function() {
artists.setSubMenu(titles, menu2, 0, 0);
};
playB.onRelease = function() {
if (loaded) {
theSong = path+titles.getSelectedItem().label+".mp3";
s = new Sound(this);
s.loadSound(theSong, true);
s.setVolume(volSlide._x - 230);
s.start(0,1);
playB.setLabel("Stop");
pause.setEnabled(true);
} else {
s.stop();
pause.setEnabled(false);
playB.setLabel("Start Again");
}
loaded = !loaded;
};
pause.onRelease = function() {
if (!paused) {
s.stop();
playB.setEnabled(false);
stopped = s.position/1000;
this.setLabel("Continue");
} else {
this.setLabel("Pause");
s.start(stopped,1);
playB.setEnabled(true);
}
paused = !paused;
};
volSlide.onPress = function() {
volSlide.startDrag(true, 242, 274, 342, 274);
volSlide.onEnterFrame = function() {
s.setVolume(volslide._x - 242);
};
};
volSlide.onRollOut = volslide.onRelease = volslide.onReleaseOutside = function() {
stopDrag();
};
panSlide.onPress = function() {
panSlide.startDrag(true, 431, 274, 531, 274);
panSlide.onEnterFrame = function() {
s.setPan(panslide._x - 431);
};
};
panSlide.onRollOut = panslide.onRelease = panslide.onReleaseOutside = function() {
stopDrag();
};
View Replies !
View Related
Mp3 Player With 3 Listboxes And Category/subcategory
Hi,
I am trying to hack this mp3 player so that it displays 3 levels of hierarchy instead of 2. Check out the current player here http://www.yanwhite.com/staging/GetGoodMusic/music.htm
Currently it has kind of 3 levels, but using 2 buttons for the top level.
I want all 3 as list boxes. So that listbox1 has main categories, listbox2 displays subcategories and listbox3 displays the tracks.
Here is the actionscript..
//setting it up
//change path to your own
path = "http://billwatson2.no-ip.info/public/flash/music/";
loadBB.setLabel("By Mood");
loadB.setLabel("By Genre");
pause.setLabel("Pause");
playB.setLabel("Play");
pause.setEnabled(false);
playB.setEnabled(false);
//constucting menu system
//next few functions just allow 1 listbox to chat to the other
function Labels() {
this.lab = new Array(0);
this.dat = new Array(0);
}
Labels.prototype.addLabel = function(name, value) {
this.lab.push(name);
this.dat.push(value);
};
Labels.prototype.change = function(obj) {
var i;
obj.removeAll();
for (i=0; i<this.dat.length; i++) {
obj.addItem(this.lab[i], this.dat[i]);
}
obj.setScrollPosition(0);
};
FlistBoxClass.prototype.changeLabels = function() {
this.getValue().change(this.sub);
};
FlistBoxClass.prototype.setSubMenu = function(sub, label, x, y) {
label.change(this);
this.sub = sub;
this.setChangeHandler("changeLabels", this);
this.setSubIndex(x, y);
};
FlistBoxClass.prototype.setSubIndex = function(x, y) {
this.setSelectedIndex(x);
this.sub.setSelectedIndex(y);
};
//change what you like here to add your own artists and songs
//just make sure the title of the song is the same as the name of the mp3
//eg for myGreatSong.mp3 add the title as myGreatSong
//the data being added to the listbox is for demonstration only as no use is made of it
menu = new Labels();
menu.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
submenu.addLabel("Telegraph Road", 4);
submenu.addLabel("I Want my MTV", 4);
menu.addLabel("Eagles", submenu=new Labels());
submenu.addLabel("Desperado", 1);
submenu.addLabel("Hotel California - Unplugged", 2);
submenu.addLabel("Lying Eyes", 3);
submenu.addLabel("New Kid In Town", 4);
submenu.addLabel("On the Border - Already Gone", 5);
submenu.addLabel("Take It To The Limit", 6);
submenu.addLabel("Peaceful, Easy Feeling", 7);
submenu.addLabel("Take it Easy", 8);
submenu.addLabel("Tequila Sunrise", 9);
menu.addLabel("The Beatles", submenu=new Labels());
submenu.addLabel("Come Together", 1);
submenu.addLabel("Here Comes the Sun", 2);
submenu.addLabel("Hey Jude", 3);
submenu.addLabel("Lady Madonna", 4);
submenu.addLabel("Lucy In the Sky With Diamonds", 5);
submenu.addLabel("Maxwell's Silver Hammer", 6);
submenu.addLabel("Octopus's Garden", 7);
submenu.addLabel("Revolution 1", 8);
submenu.addLabel("While My Guitar Gently Weeps", 9);
menu.addLabel("Bob Marley", submenu=new Labels());
submenu.addLabel("No Woman No Cry", 1);
submenu.addLabel("Jammin", 2);
submenu.addLabel("Exodus", 3);
menu.addLabel("Bob Dylan", submenu=new Labels());
submenu.addLabel("Like A Rolling Stone", 1);
submenu.addLabel("Mr Tamborine Man", 2);
menu.addLabel("Rolling Stones", submenu=new Labels());
submenu.addLabel("Wild Horses", 2);
menu2 = new Labels();
menu2.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
//formatting buttons and listboxes....change to suit
aformat = new FStyleFormat();
aformat.textSize = 12;
aformat.textColor = 0xffff00;
aformat.textBold = false;
aformat.textUnderline = false;
aformat.textFont = "Arial";
aformat.face = 0x000000;
aformat.arrow = 0xffffff;
aformat.highlight = 0x0000ff;
aformat.highlight3D = 0x0000ff;
aformat.darkshadow = 0x0000ff;
aformat.shadow = 0x0000ff;
aformat.background = 0x123456;
aformat.selection = 0xffffff;
aformat.selectionUnfocused = 0xff0000;
aformat.textSelected = 0x0000ff;
aformat.applyChanges();
aformat.addListener(playB, pause, loadB, loadBB, artists, titles);
//titles list box handler
titles.setChangeHandler("playsongs");
function playsongs() {
s.stop();
delete s;
playB.setEnabled(true);
playB.setLabel("Play");
pause.setLabel("Pause");
pause.setEnabled(false);
loadB.setEnabled(true);
loadB2.setEnabled(true);
loaded = true;
paused = false;
}
//code for buttons
loadB.onRelease = function() {
artists.setSubMenu(titles, menu, 0, 0);
};
loadBB.onRelease = function() {
artists.setSubMenu(titles, menu2, 0, 0);
};
playB.onRelease = function() {
if (loaded) {
theSong = path+titles.getSelectedItem().label+".mp3";
s = new Sound(this);
s.loadSound(theSong, true);
s.setVolume(volSlide._x - 230);
s.start(0,1);
playB.setLabel("Stop");
pause.setEnabled(true);
} else {
s.stop();
pause.setEnabled(false);
playB.setLabel("Start Again");
}
loaded = !loaded;
};
pause.onRelease = function() {
if (!paused) {
s.stop();
playB.setEnabled(false);
stopped = s.position/1000;
this.setLabel("Continue");
} else {
this.setLabel("Pause");
s.start(stopped,1);
playB.setEnabled(true);
}
paused = !paused;
};
volSlide.onPress = function() {
volSlide.startDrag(true, 242, 274, 342, 274);
volSlide.onEnterFrame = function() {
s.setVolume(volslide._x - 242);
};
};
volSlide.onRollOut = volslide.onRelease = volslide.onReleaseOutside = function() {
stopDrag();
};
panSlide.onPress = function() {
panSlide.startDrag(true, 431, 274, 531, 274);
panSlide.onEnterFrame = function() {
s.setPan(panslide._x - 431);
};
};
panSlide.onRollOut = panslide.onRelease = panslide.onReleaseOutside = function() {
stopDrag();
};
View Replies !
View Related
Mp3 Player With 3 Listboxes And Category/subcategory
Hi,
I am trying to hack this mp3 player so that it displays 3 levels of hierarchy instead of 2. Check out the current player here http://www.yanwhite.com/staging/GetGoodMusic/music.htm
Currently it has kind of 3 levels, but using 2 buttons for the top level.
I want all 3 as list boxes. So that listbox1 has main categories, listbox2 displays subcategories and listbox3 displays the tracks.
Here is the actionscript..
//setting it up
//change path to your own
path = "
View Replies !
View Related
Mp3 Player With 3 Listboxes And Category/subcategory
Hi,
I am trying to hack this mp3 player so that it displays 3 levels of hierarchy instead of 2. Check out the current player here http://www.yanwhite.com/staging/GetGoodMusic/music.htm
Currently it has kind of 3 levels, but using 2 buttons for the top level.
I want all 3 as list boxes. So that listbox1 has main categories, listbox2 displays subcategories and listbox3 displays the tracks.
Here is the actionscript..
//setting it up
//change path to your own
path = "http://billwatson2.no-ip.info/public/flash/music/";
loadBB.setLabel("By Mood");
loadB.setLabel("By Genre");
pause.setLabel("Pause");
playB.setLabel("Play");
pause.setEnabled(false);
playB.setEnabled(false);
//constucting menu system
//next few functions just allow 1 listbox to chat to the other
function Labels() {
this.lab = new Array(0);
this.dat = new Array(0);
}
Labels.prototype.addLabel = function(name, value) {
this.lab.push(name);
this.dat.push(value);
};
Labels.prototype.change = function(obj) {
var i;
obj.removeAll();
for (i=0; i<this.dat.length; i++) {
obj.addItem(this.lab[i], this.dat[i]);
}
obj.setScrollPosition(0);
};
FlistBoxClass.prototype.changeLabels = function() {
this.getValue().change(this.sub);
};
FlistBoxClass.prototype.setSubMenu = function(sub, label, x, y) {
label.change(this);
this.sub = sub;
this.setChangeHandler("changeLabels", this);
this.setSubIndex(x, y);
};
FlistBoxClass.prototype.setSubIndex = function(x, y) {
this.setSelectedIndex(x);
this.sub.setSelectedIndex(y);
};
//change what you like here to add your own artists and songs
//just make sure the title of the song is the same as the name of the mp3
//eg for myGreatSong.mp3 add the title as myGreatSong
//the data being added to the listbox is for demonstration only as no use is made of it
menu = new Labels();
menu.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
submenu.addLabel("Telegraph Road", 4);
submenu.addLabel("I Want my MTV", 4);
menu.addLabel("Eagles", submenu=new Labels());
submenu.addLabel("Desperado", 1);
submenu.addLabel("Hotel California - Unplugged", 2);
submenu.addLabel("Lying Eyes", 3);
submenu.addLabel("New Kid In Town", 4);
submenu.addLabel("On the Border - Already Gone", 5);
submenu.addLabel("Take It To The Limit", 6);
submenu.addLabel("Peaceful, Easy Feeling", 7);
submenu.addLabel("Take it Easy", 8);
submenu.addLabel("Tequila Sunrise", 9);
menu.addLabel("The Beatles", submenu=new Labels());
submenu.addLabel("Come Together", 1);
submenu.addLabel("Here Comes the Sun", 2);
submenu.addLabel("Hey Jude", 3);
submenu.addLabel("Lady Madonna", 4);
submenu.addLabel("Lucy In the Sky With Diamonds", 5);
submenu.addLabel("Maxwell's Silver Hammer", 6);
submenu.addLabel("Octopus's Garden", 7);
submenu.addLabel("Revolution 1", 8);
submenu.addLabel("While My Guitar Gently Weeps", 9);
menu.addLabel("Bob Marley", submenu=new Labels());
submenu.addLabel("No Woman No Cry", 1);
submenu.addLabel("Jammin", 2);
submenu.addLabel("Exodus", 3);
menu.addLabel("Bob Dylan", submenu=new Labels());
submenu.addLabel("Like A Rolling Stone", 1);
submenu.addLabel("Mr Tamborine Man", 2);
menu.addLabel("Rolling Stones", submenu=new Labels());
submenu.addLabel("Wild Horses", 2);
menu2 = new Labels();
menu2.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
//formatting buttons and listboxes....change to suit
aformat = new FStyleFormat();
aformat.textSize = 12;
aformat.textColor = 0xffff00;
aformat.textBold = false;
aformat.textUnderline = false;
aformat.textFont = "Arial";
aformat.face = 0x000000;
aformat.arrow = 0xffffff;
aformat.highlight = 0x0000ff;
aformat.highlight3D = 0x0000ff;
aformat.darkshadow = 0x0000ff;
aformat.shadow = 0x0000ff;
aformat.background = 0x123456;
aformat.selection = 0xffffff;
aformat.selectionUnfocused = 0xff0000;
aformat.textSelected = 0x0000ff;
aformat.applyChanges();
aformat.addListener(playB, pause, loadB, loadBB, artists, titles);
//titles list box handler
titles.setChangeHandler("playsongs");
function playsongs() {
s.stop();
delete s;
playB.setEnabled(true);
playB.setLabel("Play");
pause.setLabel("Pause");
pause.setEnabled(false);
loadB.setEnabled(true);
loadB2.setEnabled(true);
loaded = true;
paused = false;
}
//code for buttons
loadB.onRelease = function() {
artists.setSubMenu(titles, menu, 0, 0);
};
loadBB.onRelease = function() {
artists.setSubMenu(titles, menu2, 0, 0);
};
playB.onRelease = function() {
if (loaded) {
theSong = path+titles.getSelectedItem().label+".mp3";
s = new Sound(this);
s.loadSound(theSong, true);
s.setVolume(volSlide._x - 230);
s.start(0,1);
playB.setLabel("Stop");
pause.setEnabled(true);
} else {
s.stop();
pause.setEnabled(false);
playB.setLabel("Start Again");
}
loaded = !loaded;
};
pause.onRelease = function() {
if (!paused) {
s.stop();
playB.setEnabled(false);
stopped = s.position/1000;
this.setLabel("Continue");
} else {
this.setLabel("Pause");
s.start(stopped,1);
playB.setEnabled(true);
}
paused = !paused;
};
volSlide.onPress = function() {
volSlide.startDrag(true, 242, 274, 342, 274);
volSlide.onEnterFrame = function() {
s.setVolume(volslide._x - 242);
};
};
volSlide.onRollOut = volslide.onRelease = volslide.onReleaseOutside = function() {
stopDrag();
};
panSlide.onPress = function() {
panSlide.startDrag(true, 431, 274, 531, 274);
panSlide.onEnterFrame = function() {
s.setPan(panslide._x - 431);
};
};
panSlide.onRollOut = panslide.onRelease = panslide.onReleaseOutside = function() {
stopDrag();
};
View Replies !
View Related
Mp3 Player With 3 Listboxes And Category/subcategory
Hi,
I am trying to hack this mp3 player so that it displays 3 levels of hierarchy instead of 2. Check out the current player here http://www.yanwhite.com/staging/GetGoodMusic/music.htm
Currently it has kind of 3 levels, but using 2 buttons for the top level.
I want all 3 as list boxes. So that listbox1 has main categories, listbox2 displays subcategories and listbox3 displays the tracks.
Here is the actionscript..
//setting it up
//change path to your own
path = "http://billwatson2.no-ip.info/public/flash/music/";
loadBB.setLabel("By Mood");
loadB.setLabel("By Genre");
pause.setLabel("Pause");
playB.setLabel("Play");
pause.setEnabled(false);
playB.setEnabled(false);
//constucting menu system
//next few functions just allow 1 listbox to chat to the other
function Labels() {
this.lab = new Array(0);
this.dat = new Array(0);
}
Labels.prototype.addLabel = function(name, value) {
this.lab.push(name);
this.dat.push(value);
};
Labels.prototype.change = function(obj) {
var i;
obj.removeAll();
for (i=0; i<this.dat.length; i++) {
obj.addItem(this.lab[i], this.dat[i]);
}
obj.setScrollPosition(0);
};
FlistBoxClass.prototype.changeLabels = function() {
this.getValue().change(this.sub);
};
FlistBoxClass.prototype.setSubMenu = function(sub, label, x, y) {
label.change(this);
this.sub = sub;
this.setChangeHandler("changeLabels", this);
this.setSubIndex(x, y);
};
FlistBoxClass.prototype.setSubIndex = function(x, y) {
this.setSelectedIndex(x);
this.sub.setSelectedIndex(y);
};
//change what you like here to add your own artists and songs
//just make sure the title of the song is the same as the name of the mp3
//eg for myGreatSong.mp3 add the title as myGreatSong
//the data being added to the listbox is for demonstration only as no use is made of it
menu = new Labels();
menu.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
submenu.addLabel("Telegraph Road", 4);
submenu.addLabel("I Want my MTV", 4);
menu.addLabel("Eagles", submenu=new Labels());
submenu.addLabel("Desperado", 1);
submenu.addLabel("Hotel California - Unplugged", 2);
submenu.addLabel("Lying Eyes", 3);
submenu.addLabel("New Kid In Town", 4);
submenu.addLabel("On the Border - Already Gone", 5);
submenu.addLabel("Take It To The Limit", 6);
submenu.addLabel("Peaceful, Easy Feeling", 7);
submenu.addLabel("Take it Easy", 8);
submenu.addLabel("Tequila Sunrise", 9);
menu.addLabel("The Beatles", submenu=new Labels());
submenu.addLabel("Come Together", 1);
submenu.addLabel("Here Comes the Sun", 2);
submenu.addLabel("Hey Jude", 3);
submenu.addLabel("Lady Madonna", 4);
submenu.addLabel("Lucy In the Sky With Diamonds", 5);
submenu.addLabel("Maxwell's Silver Hammer", 6);
submenu.addLabel("Octopus's Garden", 7);
submenu.addLabel("Revolution 1", 8);
submenu.addLabel("While My Guitar Gently Weeps", 9);
menu.addLabel("Bob Marley", submenu=new Labels());
submenu.addLabel("No Woman No Cry", 1);
submenu.addLabel("Jammin", 2);
submenu.addLabel("Exodus", 3);
menu.addLabel("Bob Dylan", submenu=new Labels());
submenu.addLabel("Like A Rolling Stone", 1);
submenu.addLabel("Mr Tamborine Man", 2);
menu.addLabel("Rolling Stones", submenu=new Labels());
submenu.addLabel("Wild Horses", 2);
menu2 = new Labels();
menu2.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
//formatting buttons and listboxes....change to suit
aformat = new FStyleFormat();
aformat.textSize = 12;
aformat.textColor = 0xffff00;
aformat.textBold = false;
aformat.textUnderline = false;
aformat.textFont = "Arial";
aformat.face = 0x000000;
aformat.arrow = 0xffffff;
aformat.highlight = 0x0000ff;
aformat.highlight3D = 0x0000ff;
aformat.darkshadow = 0x0000ff;
aformat.shadow = 0x0000ff;
aformat.background = 0x123456;
aformat.selection = 0xffffff;
aformat.selectionUnfocused = 0xff0000;
aformat.textSelected = 0x0000ff;
aformat.applyChanges();
aformat.addListener(playB, pause, loadB, loadBB, artists, titles);
//titles list box handler
titles.setChangeHandler("playsongs");
function playsongs() {
s.stop();
delete s;
playB.setEnabled(true);
playB.setLabel("Play");
pause.setLabel("Pause");
pause.setEnabled(false);
loadB.setEnabled(true);
loadB2.setEnabled(true);
loaded = true;
paused = false;
}
//code for buttons
loadB.onRelease = function() {
artists.setSubMenu(titles, menu, 0, 0);
};
loadBB.onRelease = function() {
artists.setSubMenu(titles, menu2, 0, 0);
};
playB.onRelease = function() {
if (loaded) {
theSong = path+titles.getSelectedItem().label+".mp3";
s = new Sound(this);
s.loadSound(theSong, true);
s.setVolume(volSlide._x - 230);
s.start(0,1);
playB.setLabel("Stop");
pause.setEnabled(true);
} else {
s.stop();
pause.setEnabled(false);
playB.setLabel("Start Again");
}
loaded = !loaded;
};
pause.onRelease = function() {
if (!paused) {
s.stop();
playB.setEnabled(false);
stopped = s.position/1000;
this.setLabel("Continue");
} else {
this.setLabel("Pause");
s.start(stopped,1);
playB.setEnabled(true);
}
paused = !paused;
};
volSlide.onPress = function() {
volSlide.startDrag(true, 242, 274, 342, 274);
volSlide.onEnterFrame = function() {
s.setVolume(volslide._x - 242);
};
};
volSlide.onRollOut = volslide.onRelease = volslide.onReleaseOutside = function() {
stopDrag();
};
panSlide.onPress = function() {
panSlide.startDrag(true, 431, 274, 531, 274);
panSlide.onEnterFrame = function() {
s.setPan(panslide._x - 431);
};
};
panSlide.onRollOut = panslide.onRelease = panslide.onReleaseOutside = function() {
stopDrag();
};
View Replies !
View Related
Listboxes And Error Checking: Pls Check My Actionscript
Hi,
the goal is : there are six name text boxes ( from name1 to name6)
each of them have a listbox ( name1_listbox to name6_listbox)
If a name is entered, AND if no listbox value is chosen, then error message
if a name case is empty/ or at the end, display success message.
here the actionscript :
code:
for (n=1;n<6;n++){
name = eval('name'+n);
listbox = eval('name' + n + '_listbox');
listboxarray = listbox.getselectedItems();
trace(listboxarray);
if (name.length > 0 && listboxarray.length == 0){
message_txt.text = "events have not been chosen for" + n;
}else{
message_txt.text = "success" + n;
}
}
}
the script doesn't work.. I always get a success message.. please help
Manojo
View Replies !
View Related
Dependent Combo's
Hello,
I am trying to create an application in which values of 2nd combo depends in selection of 1st combo.
1st combo > instance name "maincb"
> properties > data:carArray, foodArray, drinkArray
labels: car,food,drink
2nd combo> instance name "subcb"
AS on 1st frame:
carArray = new Array("car01", "car02", "car03");
foodArray = new Array("food01", "food02", "food03");
drinkArray = new Array("drink01", "drink02", "drink03");
function setcombo(subcb) {
subcb.removeAll();
var subcbvar = maincb.selectedItem().data;
for (i=0; i<subcbvar.length; i++) {
subcb.addItem(subcbvar[i], subcbvar[i]);
}
}
this was an example available on somesite.. and it was for flashmx not for Pro version. and I am using Pro.
Please let me know where I am going wring.
Thanks.
Wasim.
View Replies !
View Related
Dependent ComboBox
Hi,
I have a little problem regarding combobox, I have 4 combobox dependent to other combobox something like this. First combobox populate from MSSQL using asp?
But my problem is how can I populate the 2nd combo box with selected item in combo box 1?
1st combo
Island
2nd combo
Province
3rd combo
City/Municipality
4th combo
Street
Please help...
Thank you and God Bless....
View Replies !
View Related
[F8] GMT Dependent Variables
Hi.
I'm thinking about creating a background image for my website which changes due to the time of the day. EG: in the morning it is blue, noon it is white, afternoon it is red, dusk it is grey, night it is black.
Would anyone know how i'll might be able to tackle this ???
Thanks!
View Replies !
View Related
Dependent Combobox's F8
I have tried this script from OReilly ActionScript Cookbook with no luck. Should I be using event Listeners instead? Or placing the combo boxes on the stage?
Any assistance would be awesome!!
FSelectableListClass.prototype.makeDependent = function(multiDataProvider, master) {
master.setChangeHandler("updateView", this);
this.multiDataProvider = multiDataProvider;
this.master = master;
};
FSelectableListClass.prototype.updateView = function() {
var selectedIndex = this.master.getSelectedIndex();
var dp = this.multiDataProvider[selectedIndex];
this.setDataProvider(dp);
};
//create comboboxes
_root.attachMovie("FComboBoxSymbol","myComboBox1", 1);
//myComboBox1._x = 100;
//myComboBox1._y = 100;
_root.attachMovie("FComboBoxSymbol","myComboBox2", 2,{_x:150});
//create mater menu's data provider array to populate the menu
items1 = ["a", "b", "c"];
myComboBox1.setDataProvider(items1);
//create the multiDataProvider array
items2 = new Array();
items2.push(["1 a", "2 a", "3 a"]);
items2.push(["1 b", "2 b", "3 b"]);
items2.push(["1 c", "2 c", "3 c"]);
//call the makeDependent() method from item1 to item2
myComboBox2.makeDependent(items2, myComboBox1);
function newOnChange(masterMenu) {
masterMenu.updateView();
}
myComboBox1.setChangeHandler("newOnChange");
View Replies !
View Related
Dependent ComboBox
Hi,
I have a little problem regarding combobox, I have 4 combobox dependent to other combobox something like this. First combobox populate from MSSQL using asp?
But my problem is how can I put populate the 2nd combo box with selected item in combo box 1?
1st combo
Island
2nd combo
Province
3rd combo
City/Municipality
4th combo
Street
Please help...
Thank you and God Bless....
View Replies !
View Related
Dependent ComboBox
Hi,
I have a little problem regarding combobox, I have 4 combobox dependent to other combobox something like this. First combobox populate from MSSQL using asp?
But my problem is how can I put populate the 2nd combo box with selected item in combo box 1?
1st combo
Island
2nd combo
Province
3rd combo
City/Municipality
4th combo
Street
Please help...
Thank you and God Bless....
View Replies !
View Related
Time Dependent Help
I could really use some help with some time dependent actionscript. I'm having a problem figuring out what inequalities to use in my if statements. This is what I have:
onClipEvent (enterFrame) {
time=new Date(); // time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours>=8 && hours<=9) {
do something;
}
if (hours>=9 && hours<=10) {
do something else;
}
}
Of course, this doesn't work because hours isn't accurate enough. How do I get a measurement that will do something for the hour between 8 and 9 and do something else for the hour between 9 and 10. Any help would be greatly appreciated.
Thanks.
View Replies !
View Related
Redirecting To Frame Dependent On Value From ASP
Right, the problem that i'm having is that I want to redirect in Flash to 1 of 2 frames depending on the result of an ASP query.
For example the ASP is going to give me an answer of Yes or No, if it is yes then I want my Flash file to start playing Scene 2 but if it is no then I want my flash file to start playing Scene 1.
I've loaded the variables in from the asp page and can get it so that 1 of the above scenario's works but never both together.
Does anybody have any idea or is this the impossible?
View Replies !
View Related
Browser-dependent Preloaderproblem
Hi!
I have a homesite at www.helleaalto.info and it´s partially flash with preloaders. The problem is that the preloaders hang on at least some versions of explorer on Mac as well as older Netscapes, for example 4.7 on PC.
Is there anyone out there who has had the same kind of problems? Have you figured out any possible reasons?
And if you find another browser that it doesn´t work on, please report! I´d really like to know if you find any others...
The code i´m using is as follows:
1st frame:
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
if (loadedbytes == totalbytes) {
gotoAndPlay("main", 1);
}
2nd frame:
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
percentLoaded = Math.round((loadedbytes/totalbytes)*100);
bar._xscale = percentloaded;
3rd frame:
if (loadedbytes == totalbytes) {
gotoAndStop("main", 1);
} else {
gotoAndPlay("preloaderloop");
}
With the aformentioned browsers, the preloader stops at the 2nd frame... irritating. What could be wrong with the code? Or is this a known bug or something?
Thanks in advance...
Ville.
View Replies !
View Related
Is Asfunction Browser Dependent
I'm coding a bunch of dynamic, html-enabled text fields with asfunction calls embeded:
Code:
myText = "<p align='center'><font color='#0099FF'><u><A HREF="asfunction:s2Open">Click here to continue.</u></font></a></p>"
Everything's working fine in IE...do i need to worry about other broswer versions? pc-platform only, thankfully.
thankx
--steve...
View Replies !
View Related
Dependent Button States
Hi
Making a new navigation system and have become a little unstuck.
Each button has a rollOver, Out and Clicked state which works fine.
I want it so that when you click 1 button, then click another the first reverts back to its original state with (blue to white) transition.
I need something like if a button is clicked and another is already down then make down button play 'revert fade' mx fla attached if anyone can help.
Thanks
+
View Replies !
View Related
XML Dependent Button Functionality
So I want to use this very simple XML file and use it to create some buttons and their labels. I want each button to have the same functionality, that when you click it, a dynamic text box is populated with the label of the button.
Catch is, I need the button components to be pulled dynamically with actionscript, so no instances of the button component can be on the stage.
Right now when I click any of the buttons it populates with option 4.
Banging my head on the desk with this one, any help/advice is appreciated.
Here's the code:
XML file
<?xml version="1.0"?>
<menu name="example">
<DBbutton name="option 1" />
<DBbutton name="option 2"/>
<DBbutton name="option 3"/>
<DBbutton name="option 4"/>
</menu>
actionscript (only thing on the stage is a dynamic text box called options box, and "Button" is the name of the component button in the library)
loadButtons = function(container, name, depth, node_xml) {
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth)
for (var i=0; i<node_xml.childNodes.length; i++) {
curr_item = curr_menu.attachMovie("Button","item"+i+"_mc", depth+i);
curr_node = node_xml.childNodes[i];
curr_item.label= curr_node.attributes.name;
curr_item._y = i*40;
// set behavoir for each button
var button_listener = new Object();
button_listener.click = function(evtObj:Object){
optionsBox.text = curr_item.label;
};
curr_item.addEventListener("click", button_listener);
curr_item.setSize(300,24);
} // end loop
}//end loadButtons
menu_xml = new XML();
menu_xml.load("options.xml");
menu_xml.ignoreWhite= true;
menu_xml.onLoad = function(ok) {
loadButtons(_root,"mainmenu_mc", 1, menu_xml.firstChild);
}
stop();
View Replies !
View Related
Problem In IE - Dependent On Path To The .swf
Hey All,
I try not to post questions unless I can't find the answer anywhere else, and I find myself in that situation now. I've searched Microsoft and I've searched these forums for posts from others with the same problem.....and no, it's not about the gray border showing up around my embedded flash when viewing in IE! lol I already have that one covered.
I have a page on my site that allows users to link to us. The page offers banner ads in both animated gif and flash formats, and the code to put these banners onto users' own web pages is also offered. You can view the page here:
http://www.reallivesports.com/linkUs_banners.html
All the flash banners are is a looping animation and the functionality of opening a web page when the user clicks the animation (using the simple getURL function).
Now, I've done some testing and found that everything works fine in browsers like Firefox. Microsoft IE, however, does not open the webpage when the animation is clicked....at least not with the code I'm offering my users. It seems that it WILL work in IE if the .swf file is located locally to the .html page that is calling it. However, if the .html page is pulling the .swf file from an external domain, the animation will show up, but the clicking functionality will not work. I hope I'm being clear in my wording. Lemme give you the 2 examples just in case:
EXAMPLE 1 - My site is www.mysite.com and the source path for the banner is http://www.reallivesports.com/rls_480x60.swf
RESULT - Animation shows up, but clicking on it does nothing.
EXAMPLE 2 - My site is www.mysite.com and I have the .swf for the banner on my server, so my source path to it is local. Simply, rls_480x60.swf
RESULT - Animation shows up, and clicking on it takes me to the appropriate web page.
So....yeah. Any insight anyone may offer would be greatly appreciated. My apologies if this is a very newbie question, but I'm still learning!
Ed
View Replies !
View Related
Setting Time-dependent Greetings.
Hi everyone,
I've got a movieclip with a dynamic text box called "time" on my stage, which gets the time, day, date and year. That part works perfect. The code for the movieclip if you're interested is....
onClipEvent (load){
// Arrays for Month and Week Days.
mon = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","O ct","Nov","Dec"];
weekdays = ["Sunday","Monday","Tuesday","Wednesday","Thursday" ,"Friday","Saturday"];
}
onClipEvent (enterFrame){
// Working out Day, Date and Year display.
now = new Date()
nDay = weekdays[now.getDay()]
nMonth = mon[now.getMonth()]
nDate = now.getDate()
nYear = now.getFullYear()
// Time display. Displays hours, minutes and seconds in 24 hours time format.
myTime = new Date();
nSeconds = myTime.getSeconds();
nMinutes = myTime.getMinutes();
nHours = myTime.getHours();
// Sets 24 hour format on the hours display.
if (hours>=13) {
nHours = nHours-12;
}
//if the minutes are a single digit, for example 7 minutes past the hour then add a 0 infront of the minute making it 07 minutes.
if (length(nMinutes) == 1) {
nMinutes = "0"+nMinutes;
}
//if the seconds are a single digit, for example 7 seconds then add a 0 infron it the second making it 07 seconds.
if (length(nSeconds) == 1) {
nSeconds = "0"+nSeconds;
}
//nTime is the dynamic text instance name.
nTime = nHours+":"+nMinutes+":"+nSeconds+" l "+nDay+" l "+nMonth+" "+nDate+", "+nYear;
}
ANYWAY....on with the show.
I'd like to have a movieclip, for example "greeting" that says GOOD MORNING, GOOD AFTERNOON or GOOD EVENING dependent upon the current time.
Can anyone give me any pointers??!!
Thanks.
View Replies !
View Related
Dependent Button States
Wondering if anyone could help...
I'm developing a flash game based on the UK TV show 'Blockbusters' to use as a teaching aid with my students.
I'm trying to find a way of changing a button's colour *after* it has been
hit to either white or blue, depending upon which team has answered a question (there are 20 of these buttons - see attached screenshot). I imagine that I will need to use radio buttons or similar to determine which team is currently selected, but am struggling to find a way to implement it all...
Any ideas / help would be much appreciated.
Cheers,
RnR
View Replies !
View Related
Server Dependent CSV Parsing
Hi. I've got a Flash site that uses a loadvars object to load a csv file that I then parse into arrays. The swf works great locally and on two hosts I have tested it on. However, I can't get it to work on the host server I own (er..rent). The HTML file, swf and csv are all stored on the same level and I've even included a policy file just in case. Additionally, I have changed the path to the csv in the Flash file several times to see if that was the issue.
I created a trace that indicates my data is loading, but the functionality isn't working, leading me to believe the parsing is at issue. Any ideas why this file would work fine on two other servers but bomb on a third?? I'm completely stumped.
Thanks a bunch.
jap
View Replies !
View Related
Setting Time-dependent Greetings.
Hi everyone,
I've got a movieclip with a dynamic text box called "time" on my stage, which gets the time, day, date and year. That part works perfect. The code for the movieclip if you're interested is....
onClipEvent (load){
// Arrays for Month and Week Days.
mon = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","O ct","Nov","Dec"];
weekdays = ["Sunday","Monday","Tuesday","Wednesday","Thursday" ,"Friday","Saturday"];
}
onClipEvent (enterFrame){
// Working out Day, Date and Year display.
now = new Date()
nDay = weekdays[now.getDay()]
nMonth = mon[now.getMonth()]
nDate = now.getDate()
nYear = now.getFullYear()
// Time display. Displays hours, minutes and seconds in 24 hours time format.
myTime = new Date();
nSeconds = myTime.getSeconds();
nMinutes = myTime.getMinutes();
nHours = myTime.getHours();
// Sets 24 hour format on the hours display.
if (hours>=13) {
nHours = nHours-12;
}
//if the minutes are a single digit, for example 7 minutes past the hour then add a 0 infront of the minute making it 07 minutes.
if (length(nMinutes) == 1) {
nMinutes = "0"+nMinutes;
}
//if the seconds are a single digit, for example 7 seconds then add a 0 infron it the second making it 07 seconds.
if (length(nSeconds) == 1) {
nSeconds = "0"+nSeconds;
}
//nTime is the dynamic text instance name.
nTime = nHours+":"+nMinutes+":"+nSeconds+" l "+nDay+" l "+nMonth+" "+nDate+", "+nYear;
}
ANYWAY....on with the show.
I'd like to have a movieclip, for example "greeting" that says GOOD MORNING, GOOD AFTERNOON or GOOD EVENING dependent upon the current time.
Can anyone give me any pointers??!!
Thanks.
View Replies !
View Related
Banner Dependent On Page
I am running a site, www.projectcafe.org, using Drupal. I am curious how I would implement a flash banner that would be different on the index page then all the other pages.
Bascially, how do I tell Flash to display a certain movie clip depending on what URL the .SWF is being displayed at?
Thanks for any help!
View Replies !
View Related
Speed Is Browser *&* CPU Dependent?
I've got a function with a lineTo going on which is being called using setInterval . The movie's fps is set to 50, interval is set to 1.
When I preview it as an SWF I get the speed I want, yet when I do it through html, it's really slow.
Any ideas?
View Replies !
View Related
Loading Content Dependent On VAR's
Ok, it's kind of a basic question. I'm pretty sure I have it right, but just wanted to check if this is the correct way to do this.
I have a series of buttons, each sets the ProductID var to its model # then sends the movie to play a frame with this:
loadMovie(('_global.ProductID'+'.jpg'), "img_container_mc.img_container");
If the variable is set to - SB156
using this code, will it load - SB156.jpg?
View Replies !
View Related
Dependent Files When Shipping Flash.ocx
Hi All,
Is it okay to just ship flash.ocx (Flash MX control) to run an SWF created in Flash MX. Are there any dependent files?
Some time back when i investigated, i found that the flash6 player setup also had other dependent files like w95inf16.dll,w95inf32.dll, advpack.dll.
Are these files really needed?
Regards,
Shalin
View Replies !
View Related
Dependent Files Message Box - Sigh
I finally talked my employer into getting Dreamweaver. However, I have one issue using it.
I use it for all of my files - css, html, javascript, etc . . . Every time I edit the css file it wants to save a dependent file. ( an image I reference in the stylesheet ). The prompt comes up every single time.
Is there any preference I can set so that it will stop prompting me? I have looked and cannot seem to find it. Any help would be greatly appreciated.
Jim
View Replies !
View Related
Dependent List/combo Boxes
I would like some help on how I would code the choices in a combo box to trigger a list of items to display either in a list box or in another combo box. The each of the data items displayed would then have to be linked to a url.
For example.
In the combo box there would be the selections "fruit, vegtables, drinks"
If you selected fruit in the list box it would output "apples, oranges, pears, etc"
Apples would link to a website on apples. Oranges would link to a website on oranges. And pears would link to a website on pairs.
Let me known if you need more information. A detailed explanation would be greatly appreciated please.
View Replies !
View Related
How Do I Goto A Frame Dependent On Time Of Day
Hey all,
Preety sure what I want to do is rather simple, I'm just not a pro just yet at Flash. Basically what I want to do is havy my homepage display an animation dependent on the time of day. So what I want to do is send the user to a specific frame on the timeline dependent on what time of day it is. What would the actionscript look like? Any help would be much appreciated.
View Replies !
View Related
Wave Size Dependent On Mouse?
Hi, I dont remember where I've seen this feature, but I've seen a feature where you enter a page which is devided horizontally by a line, and then when the mouse pointer is moved over this line it moves in a wave-like fashion? Anyone knows how this is done? I know how to make a simple sine wave but I dont know how to make its waves' sizes dependent on where the mouse is?
pls help
View Replies !
View Related
HitTest Action Dependent On _global
Same objective, different question...... In a previous thread, I asked how I could check a variable with a hitTest. I figured out how to check the variable, but it didn't solve my problem. I need the hitTest to act according to which _global variable is set.
I need the hitTest to do something similar to this:
Code:
onClipEvent (enterframe) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if(global_one)
this.doOneThing();
} else {
this.prevFrame();
}
if(global_two)
this.doSomeThingDifferent();
} else {
this.prevFrame();
}
}
It seems as if it would be as simple as above, but nothing I try will work. Any suggestions?
View Replies !
View Related
Flash Actions Dependent Upon PHP Vars
Hello,
For a while now I've tried to get flash to send PHP data, and then back again to flash. Finally with that bit a success, my next step is back in the hands of flash. Basically depending upon the data PHP sends to Flash, (or that flash reads from the PHP's "echo") I want flash to compare that data and go play a certain keyframe. I'll show the code below, but my basic algorithm is thus:
1. Flash presents the user with an input text field, dynamic text field, and a button on the 1st keyframe.
2a. The user enters in data, presses the button.
2b. PHP receives the input
2c. PHP echo's the variable such that flash can read it. ( echo "read=" . $variable_test; )
3. The dynamic text field displays the inputted data.
This part works allright. The problem comes with flash trying to compare the data.
In flash I have 3 keyframes.
The 1st keyframe has the interface that the user is presented with as I mentioned before.
The 2nd keyframe has a static txt field that says "Frame 2" with the same dynamic text field in the first key frame.
The 3rd keyframe has a static txt field that says "Frame 3" with the same dynamic text field in the first key frame.
(There is a "stop();" action on all of these frames.)
The button on the first key frame has this code:
on( release )
{
loadVariablesNum( "test.php", 0, "POST" );
}
Now, Here I think lies the problem. I have this bit of comparison code:
if( read == 2 )
{
gotoAndPlay( 2 );
}
else if( read == 3 )
{
gotoAndPlay( 3 );
}
And I've literally tried placing it everywhere. But to no avail.
Basically all I want is that when the user (me, just for test purposes) enters "2" into the Input Text Field on the first keyframe of flash, it should immediatley throw me to the 2nd keyframe of my timeline. If I typed in 3 in the Input text field, it should throw me to the 3rd key frame.
The closest I've gotten was clicking the button, having my dynamic txt field on the 1st keyframe display my input, and when I clicked the button again, it went to the appropriate keyframe.
I'd apprecaite any assistance, really, and can provide a file in necessary. It all seems so simple enough and I'll probably kick myself later for it.
Thanks!
View Replies !
View Related
Sound Dependent On Html Page...
I have a header flash animation that holds the site navigation and a cool 2 second animation with sound. I only want the sound clip to play on the homepage, however, since hearing it with every click makes me want to smash my keyboard into my monitor. Any idea how to do this?
Thanks.
View Replies !
View Related
FLVs And XML - Date/Time Dependent
I am stuck. I figured out that this site is not a live enviroment, rather using FLVs for certain days of the week - and the office is even all dark after 6PM. Looks like they have an FLV library loading clips for specific days and also for the time of day. I am trying to do the same but I am stuck on my CS3 code. I think my problem resolves here:
var CurrentDate = GetPHL_date();
It doesn't seem to retrieve date - videos won't load! IS it because this site might be used in conjunction with FCS?
To see what I'm trying to do, please visit this site:
www.customedialabs.com
Any help you can offer - I would be most appreciative.
Jerry
View Replies !
View Related
|