Disabling List Item?
This is driving me crazy, it seems like it should be simple but I haven't been able to find any documentation on it anywhere. I have a List() that I've created and populated with a DataProvider. I want it so that when you click on a list item that item becomes disabled (in the same way you set list.enabled = false).
Since I haven't found out how to disable the list, I have something like this which just removes the entry:
Code: list.addEventListener(Event.CHANGE, stuff);
function stuff(event:Event) { list.removeItem(event.target.selectedItem); } I've tried event.target.enabled = false and event.target.selectedItem.enabled = false and neither are working, and I can't find jack diddly anywhere about how to disable individual list items so that you can't click on them.
FlashKit > Flash Help > Actionscript 3.0
Posted on: 09-25-2007, 05:02 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Disabling A List Item Onclick
I have a List() component populated by a data provider. The list has a custom style set to an external AS class that extends CellRenderer. What I want to do is when a list item is clicked, I want to gray out that item. I have the styles for graying it out, I just need to set the style for the clicked list item. I asked this question once before and got an answer in this thread:
http://board.flashkit.com/board/show...hreadid=745726
The problem is that solution doesn't handle onclicks, just static lists. So how do I capture the onclick and set the styles for the list item so that it's gray when you click on it?
Disabling A List Component Row/item
Been searching around for what seems a rather essential thing - being able to disable a row/item in a list component. Have found an AS2 answer that may or may not work - but I'm looking for something in AS3.
Where I've got to:
I've created a new class that extends the CellRenderer class (and so implements ICellRenderer).
I've overridden the set listData method. In the new method, I check for the presence or lack of a data element (enabled, say) and can then set the style of that row accordingly.
What I can't work out how to do is stop that row from responding to rollover and mouseUp/Down events. Presumably I need to removeEventHandler from that row - but what is the event handler called for the CellRenderer class?
Anyone got any thoughts on how to achieve this - either by completing this method above or via some other route?
What would obviously help is some sort of more complete documentation on dealing with the components - but haven't seen anything beyond the adobe livedocs which are very far from complete as far as I can tell.
Thanks,
Alex
Chnage The Font Of Selected Item Color In A List Mx:List
Hi,am Trying to change the font (bold and color) of a selcted item in List..But it is changing the complete list's font..
Here it is my code..
<mx:List id="businessFunctions" left="10" right="10" bottom="10" top="208"
dataProvider="{processList}"
itemClick="select();"
horizontalScrollPolicy="auto"
labelField="@name"/>
ActionScript COde:
private function select():void
{
businessFunctions.setStyle("textSelectedColor","#D 3E9F5");
businessFunctions.setStyle("fontWeight","bold");
var page:XML = businessFunctions.selectedItem.page[0];
var pageID:String = page.@id;
var processID:String = businessFunctions.selectedItem.@id;
server.submit(pageID, processID, RequestMessage.BEGIN);
}
Here i need toc hange the selected item color only..
XML List Item
Hola,
I am making a presentation with flash and XML,
now I want to use list items in my presentation,
but when I use
<li>blabla</li>
I dont see the dics that I want to see.
How can I fix this?
Unselect An Item In A List Box?
Hello,
Can anyone give me the code used to unselect an item in a list box? When a user clicks on a button I would like what ever item is selected in list_box_a to be unselected.
Thanks!!
Movieclip As List Box Item ?
Is it possible to use a movieClip as the items in a list box??
I have a simple list box (like so: http://www.kirupa.com/developer/mx/listbox.htm ) but I would like to use a movieClip for the items and to also customise the scroll bars. Each list item will include a combination of image, icons and text.
I've not come across any examples of this. I'm thinking maybe it's not possible with the list box!!
I guess this would be easily done in Flash 8 but I need to export the swf to v6.
Anyone have any suggestions/help?
Cheers,
Ty
ParseInt List Item
I'm importing my variables from an external text file. The array weekToDate is strictly a numeric list but is being interpreted as a string. Why is it that I can't do the following (parseInt(weekToDate[i]) It returns a value of NAN. Any ideas?
for (var i = 0; i < (weekToDate.length); i++) {
_root.branchAtB += parseInt(weekToDate[i]);
}
Get List Item Data From Icon Mc?
I'm using movie clips for icons in the F8 list component. The icon has a button in it. I need to get the data for the list item the icon is in to use with the button, but I can't seem to figure out where the data is located.
From the icon, what would the path to the data/label of the list item be?
thanks.
Load Item List From Text
Hi
Is there any way I can have a really simple text file like this ....
item1
item2
item3
item4
.... load these into flash as seperate values and push them into an array? I'd prefer it to be a simple list in a text file as above, rather than using xml.
thanks
mark
flash8
1 List Item Control Several Movieclips?
Hi...
Check out www.expocadvr.com/new/default.html
I have an exhibitor list that loads from xml...and I have a booth layout that loads from a separate xml...I have two arrays set up so that the rented booths are stored first, and the exhibitors are stored in a separate array side by side...
if you click on an exhibitor in the list you will see the associated booth highlight in the mainwindow (and minimap too)...however if you notice, there are multiple entries in the list for some exhibitors, this is because they may rent several booths...I want to condense the exhibitor list to have one entry per exhibitor, but have the entry control all their booths, so if you click an exhibitor with 2 booths both of them would light up even though there was only one entry in the list...is this even possible with the list component provided by flash? if so can anyone point me in the right direction?
thanks,
Paul
Capturing The Item You Rollover In A List
Can someone tell me how you get the target of what item is being rolled over in a list component.
I have tried e.target.item.data but with no luck? I used the ListEvent.item_clicked.
any help appreciated.
Thanks.
Accessing Selected Item Of A LIst
Hi,
I'm trying to access the selected item idex label of a click list.
I normally havn' t had any trouble with this before. I seem to be having a problem because the list is inside a movie clip.
First of all I attach a movieclip containing a list to a container
///////////////////////////////////////////////////////////////////////
var player:Object = getDefinitionByName("Player") as Class;
var clipPlayer:MovieClip = new player();
clipPlayer.name="player"
clipPlayer.x=200;
clipPlayer.y=200;
Container.addChild(clipPlayer);
//////////////////////////////////////////////////////////////////////////
Then I add data to the list
///////////////////////////
var temp:Array=arr;
for (var i=0; i<temp.length; i++) {
var obj:Object=temp;
var id:int =obj.ID;
var d:String=obj.Name;
var s:String=obj.SourcePath;
//trace("test"+d+"***")
var c=Container.getChildAt(0);
c.clipListBox.addItem({label:d,data:s});
c.clipListBox.addEventListener(ListEvent.ITEM_CLICK,clipItemClicked);
}
/////////////////////////
In the last line of the above code I have added an event listener named clipItemClicked.
The problem I have is in the handler for this listener.
////////////////////////////////////
public function clipItemClicked(e:ListEvent):void
trace(e.target.selectedItem.label);
}
///////////////////
When I try the above code (which I think is fairly standard) I get the following error and I dont understand why?
TypeError: Error #1009: Cannot access a property or method of a null object reference.
As far as I can see the property is not null because the list is displaying data. I'm not sure what the whole null object reference thing means.
Any ideas why I'm getting this error?
Thanks
dub
Attach Code
var player:Object = getDefinitionByName("Player") as Class;
var clipPlayer:MovieClip = new player();
clipPlayer.name="player"
clipPlayer.x=200;
clipPlayer.y=200;
Container.addChild(clipPlayer);
4 List Boxes W/ Only One Selectable Item
Is it possible to have 4 list boxes but only let the user select one item from all four list boxes? If so how?
lista = 1,2,3,4
listb = 5,6,7,8
listc = 9,10,11,12
lisrd = 13,14,15,16
The user can only select one number from the four lists
1 List Item Control Several Movieclips?
Hi...
Check out www.expocadvr.com/new/default.html
I have an exhibitor list that loads from xml...and I have a booth layout that loads from a separate xml...I have two arrays set up so that the rented booths are stored first, and the exhibitors are stored in a separate array side by side...
if you click on an exhibitor in the list you will see the associated booth highlight in the mainwindow (and minimap too)...however if you notice, there are multiple entries in the list for some exhibitors, this is because they may rent several booths...I want to condense the exhibitor list to have one entry per exhibitor, but have the entry control all their booths, so if you click an exhibitor with 2 booths both of them would light up even though there was only one entry in the list...is this even possible with the list component provided by flash? if so can anyone point me in the right direction?
thanks,
Paul
Anchor Tag Inside List Item
I have a really odd problem. In my XML file I have this:
Code:
<maincontent>
<![CDATA[<p>Checklist for new students:</p><br><li>Complete an <a href="http://www.otc.edu/students/application.php" target="_blank">application</a> for admission</li>]]>
</maincontent>
In my style sheet I have this:
Code:
p{font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12;
color:#000000;}
li{font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12;
color:#000000;
}
a:link{color:#999999;
text-decoration:underline;
}
a:hover{color:#01563f;
text-decoration:none;
}
a:active{color:#01563f;
text-decoration:none;
}
For some reason, when I hover over the link inside the bullet, the bullet changes to the color of my a:hover pseudo class. Anyone have ideas as to the problem?
Thanks.
1 List Item Control Several Movieclips?
Hi...
Check out www.expocadvr.com/new/default.html
I have an exhibitor list that loads from xml...and I have a booth layout that loads from a separate xml...I have two arrays set up so that the rented booths are stored first, and the exhibitors are stored in a separate array side by side...
if you click on an exhibitor in the list you will see the associated booth highlight in the mainwindow (and minimap too)...however if you notice, there are multiple entries in the list for some exhibitors, this is because they may rent several booths...I want to condense the exhibitor list to have one entry per exhibitor, but have the entry control all their booths, so if you click an exhibitor with 2 booths both of them would light up even though there was only one entry in the list...is this even possible with the list component provided by flash? if so can anyone point me in the right direction?
thanks,
Paul
List Item Over Flash Movie
I understand that flash movies always tend to stay on top in web design, but is there any kind of work around to allow me to use list item drop-down menus overtop of a flash banner? Any help would be appreciated.
Thanks
Anchor Tag Inside List Item
Has anyone noticed in Flash player 8 the bullet color will take on the characteristics of a styled anchor tag?
Is there a bug with HTML generated anchor tags nested inside a list item?
If anyone has a suggestion or idea, let me know.
Changing Xml Selected Item In List Box
I have followed Lee's xml video playlist to adapt the xml mp3 player from his other tutorial, but I am having problems with the selectedIndex item. The list populates ok and the track titles are selectable, it's just that the selected (highlighted) item is not changing when I click on to the next track.
Here's my code:
Code:
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++)
{
//playlist
playlist.addItem(nodes[i].attributes.artist + " - " + nodes[i].attributes.track);
sa.push(new Song(nodes[i].attributes.url, nodes[i].attributes.artist, nodes[i].attributes.track));
}
playSong(playlist.getItemAt(0).data);
playlist.selectedIndex = 0;
}
var pList:Object = new Object();
pList.change = function()
{
playSong(playlist.getItemAt(playlist.selectedIndex).data);
}
playlist.addEventListener("change", pList);
xml.load("songs.xml");
Can someone please help and let me know where I'm going wrong.
Checking Existence Of Item In List?
Hello there!
I try to solve a - probably quite simple - problem. At least I hope that this can be achieved rather simple:
The problem concerns the List Component. How can I check if an item I'd like to add is already part of the list? I'd like to avoid having double entries and if possible would like to check that either through a function that goes through all the items or through a direct command if this is possible (the keys would be the same). Is there a script perhaps somewhere to which someone could point me to?
Many thanks in advance for your time helping me
Artimidor
On Select List Item Display Picture
ok guys.I have one question:
Here is my AS in frame 1
Code:
//--------Movie Clip Loader----------\
var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
mcLoader.addListener(myListener);
myListener.onLoadProgress = function(target_mc,bytesLoaded,bytesTotal) {
extLoader_mc._visible = true;
var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
if (bytesLoaded >= bytesTotal) {
extLoader_mc._visible = false;
}
}
mcLoader.loadClip("",picViewer_mc.picLoader);
//-----------Lists-------------\
var my_list:mx.controls.List;
_global.styles.ScrollSelectList.setStyle("backgroundColor", 0xB5B590);
_global.styles.ScrollSelectList.setStyle("textAlign", "left");
//--------------my_list--------------------\
my_list.addItem({label:"CAISE CONFIATE GALBENECUTIE 5kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"CIRESE CONFIATE bidon 10kg",data:"Fructe confiate si fructe natural deshidratate/cireseconfiate.jpg"});
my_list.addItem({label:"CURMALECUTIE 5kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"LAMAI CONFIATE bidon 10kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"PEPENE CONFIAT bidon 10kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"PORTOCALE CONFIATE bidon 10kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"SMOCHINECUTIE 5kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"VISINE CONFIATE bidon 10kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"MIX FRUCTECUTIE 5kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
my_list.addItem({label:"PRUNE USCATECUTIE 5kg",data:"Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg"});
var listenerObject:Object = new Object();
listenerObject.change = function(eventObject:Object) {
mcLoader.loadClip("Fructe confiate si fructe natural deshidratate/caiseconfiategalbene.jpg",picViewer_mc.picLoader);
};
my_list.addEventListener("change", listenerObject);
When i select one item i want to display the pic in the Loader component but i dont know to do that.Any help is appreciated.Thx in advance.
Can I Use Object Property For List Item Display Name?
I use an ArrayCollection of objects as my list's dataProvider and I want the list to display each objects 'name' property as the visual part of the list item.
My class is called Alert so the list displays [Object Alert] in each line. How can I customize what is displayed? (e.g. alert_item.name)
Highlighted Default Item In List Component?
I can't seem to find how to have an item in a list component highlighted by default. I'm sure its right there in the docs staring me down, but I dont see it.
I've found scrollToIndex method, but that doesnt seem to actually highlight the index item. How do I highlight an index item in a list in as3?
Thanks,
Matt
TextField Width Of A List Component Item
Hi,
is there a way to find out the label textwidth of a list component item?
list.getItemAt(x) only returns an object but not the reference to the list item class (or whatever it is called )...
Thanks,
BMA
Array Problems With Selecting Current Item In List.
I'm still new to arrays, so excuse me if some of my syntax isn't correct.
I've got an array for an audio jukebox and I have a function that plays the current song in the array. Or so I hope. Problem is when I click on the stopSong function it does stop the current song in the array but when I click on the play button it starts all over again at song #1. So if I'm on say song #6 and I click on stop and then play I'm back at song #1 again. Here's the code I'm using for these functions in MX:
playlist = ["audio01.mp3", "audio02.mp3", "audio03.mp3", "audio04.mp3", "audio05.mp3", "audio06.mp3", "audio07.mp3", "audio08.mp3", "audio09.mp3", "audio10.mp3"];
count = 0;
function completeMe() {
count++;
mp3.loadSound(playlist[count], true);
mp3.start();
}
function playSong() {
mp3.stop();
mp3 = new Sound();
mp3.loadSound(playlist[count], true);
mp3.setVolume(50);
mp3.onSoundComplete = completeMe;
}
function stopSong() {
mp3.stop();
}
Seems right, but it isn't. Is it possible to set the playSong or stopSong functions to remember the last track I had played?
Blank (inactive) List Item For Spacer In Listbox?
I've got a listbox component that I'm trying to break up a bit by adding spacers/separators between groups of active items. In other words, I'm wondering if it's possible to add items to the listbox that are un-selectable and have no rollover action. I don't want them to highlight when the mouse rolls over them, etc.
I've found setPropertiesAt() which allows you to specify styles for individual list items, but it's restricted to just backgroundColor and icon, which doesn't help me at all :-(.
This must be possible... Does anyone out there have a suggestion?
Anchor Tag Inside List Item-Flash Player
I have a really odd problem. In my XML file I have this:
Code:
<maincontent>
<![CDATA[<p>Checklist for new students:</p><br><li>Complete an <a href="http://www.otc.edu/students/application.php" target="_blank">application</a> for admission</li>]]>
</maincontent>
In my style sheet I have this:
Code:
p{font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12;
color:#000000;}
li{font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12;
color:#000000;
}
a:link{color:#999999;
text-decoration:underline;
}
a:hover{color:#01563f;
text-decoration:none;
}
a:active{color:#01563f;
text-decoration:none;
}
For some reason, when I hover over the link that's inside the bullet, the bullet (character) changes to the color of my a:hover pseudo class in Flash player. Anyone have ideas as to the problem?
Thanks.
How Can I Select An Item From A List Component With A Seperate Button
This is a repost, I decided it'd probably be better here than in the general discussion board. I will try to delete the other one.
Hello Everyone,
This is my first post here. I am trying to figure out how to select an item within a list component with a button. This button is calling a function. I have searched for the past 3 hours online and I can't find anything about it. I thought perhaps I could set the selectedItem parameter, but that is read only, and I believe it returns an object reference rather than something like a number so even if i could set it, it would be pointless. I also found a get focus button, thought that may lead me somewhere, but I think that is for setting which component has focus currently as far as typing in and things like that. I am lost.
Basically I am looking for a way to type this myList.setSelected(5); where 5 is the 5th item in the list.
Any help would be much appreciated.
Double Click User-rendered Item In List Box
I am trying to implement a double click event with a TextField located in a user-rendered List control. I have set doubleClickEnabled on both, on just the rendered TextField item, and just the ListBox. I have found that I need doubleClickEnabled set on the TextField in order to get any type of event fired.
Here's the problem. I actually have to triple click to get the event to fire. This is because the first click actually selects the item and then the double click event will fire after two more clicks. I want it so that I only have to double click. I had this working fine in AS2 but can't for the life of me get it working with AS3.
I tried using just a CLICK event, but that always fired after a single click, whether the item was selected or not.
Any thoughts on how to make the event fire with a double click instead of a triple click when the item isn't previously selected?
Help With Loading Selected Item From List Box To Load Sound.. Please :-) .fla Attache
Hi all,
I'm stuck. I'm new to actionscript & I'm having trouble getting my listbox selection into my mysound or loadsound function.
What I've done is taken a tutorial from flashkit to create am mp3 player, & another for filling a listbox form an external text file. The player works great, & the list box works equally as well, but I can't seem to figure out how to get my song variable from the selected item in the listbox over to the play function.
What I have is 4 layers, with 3 frames each. The 3 frames of the action layer loads the text file, checks that it loaded, & parses it into arrays, & loads the arrays into the list box.
The third frame of the sound (mp3player) layer contains all the sound functions. Here is a bit of code from the third frame of sound layer:
function getSong(){
var song;
song = _root.combo.CBOLoadSites.getSelectedItem(ComboURLs[i]);
return song;
}
function playa() {
if (playing!=true) {
mysound=new Sound();
getSong();
mysound.loadSound(song, false);
mysound.start((_root.pos)/1000,1);
if (mysound.duration!=0) {
playing=true;
}
}
}
The "getSong()" function is what I added, along with its call inside "playa()". I'm not sure if I'm filling the "song" variable correctly at all inside "getSong()".
"CBOLoadSites" is the instance name of the combo box on the combo layer, & I've tried to call it as shown above, & with just:
"CBOLoadSites.getSelectedItem(ComboURLs[i])" and
"CBOLoadSites.getSelectedItem(ComboURLs)"
This seems logical to me if I where working with php, but I don't know how to get my selected item from the list box.
Attached is my .fla
Thanks for any help!!
-Sam
Grabbing BitmapData Library Item And Adding To Display List
I can't seem to get this to work with BitmapData library items, though it is working for the MovieClip items...
I have a utility function which grabs items from the library
public static function create(className:String):Class
{
return new (ApplicationDomain.currentDomain.getDefinition(cla ssName) as Class);
}
Here is the code i'm using to add the BitmapData to the stage...
var ChromeBackground:Class = Utilities.create("mc_chromeBackground");
var chromeBG_BD:BitmapData = BitmapData(new ChromeBackground());
var bmp:Bitmap = new Bitmap(chromeBG_BD);
this.addChild (bmp);
The BitmapData object isn't showing up on screen. What am i doing wrong??
THANKS in advance!!!
Lori-
[F8] List Box Make Item "non" Selectable
i know you can make the whole list box non selectable with
listboxinstance.selectable = false;
but is there a way to make a specific item in the list box non selectable??
Add Item After Selected Item In Tree Component?
I've got a tree component which works great, but I'm trying to add an item at a particular location (immediately after the item they select) into the tree.
The problem is that I'm trying to add an item within a branch. I'm using myTree.getDisplayIndex(myNode) to get the position within the tree, but it gives the location relative to the entire list, but I need to get the position relative to the parent (which is what myNode.parentNode.addTreeNodeAt is trying to write to)...
Anyone know how I can get the position of the item the user selects relative to it's branch???
Thanks!!
How Do I Stop Carousel On Item When Item Is Clicked On?
Yeah ...some of us are still trying to tweak the carousel... I need to know how to stop the carousel when an item in the carousel is clicked on. Of course I'd also like to have that item come to the front and center as well. This carousel is done without XML.
Any help would be greatly appreciated.
here's my current code:
var numOfLogos:Number = 6;
var radiusX:Number = 300;
var radiusY:Number = 50;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
for(var i=0;i
{
var t = this.attachMovie("item"+(i+1),"item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfLogos);
t.onEnterFrame = mover;
}
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/1500;
}
//INFO PANELS//
phInfoPanel_mc._visible = false;
//NOW FOR THE CLICK ACTIONS//
item0.onRelease = function () {
phInfoPanel_mc._visible = true;
phInfoPanel_mc.swapDepths(Math.round(this._xscale) + 1000);
}
List Item W/ Multiple Data Items - How To Select Data Items?
I have a list component (myListBox) that is showing the labels for some data items read in from an XML file. Each item in the list has an associated name, description, and path (they're mp3 files) and they are named accordingly in the XML tags.
Using myListBox.selectedItem.label gives the correct label but myListBox.selectedItem.data is undefined. I've tried using the XML tags after the data selector (e.g. myListBox.selectedItem.data.path) but those don't work, either. All of the examples I've found in the docs show only a single data element associated with each list item.
So, if a list item has multiple data items associated with it, how do you select them using the listBox.selectedItem property?
TIA,
rgames
Make Item Grab Another Item
I am working on a game right and i want oneitem that when it touches the other stays with it like glue here is my code:
instance name:
i have a guy _root.player.hand
A ball _root.ball
so I put on the ball this code....
onClipEvent(enterframe){
if(this.hitTest(_root.player.hand)){
this._x = _root.player.hand._x;
this._y = _root.player.hand._y;
}
When the hand touches the bal he ball goes where the hand was originaly and that is it it never moves again.
can some one help ???
}
Disabling Hand Cursor Over Html Links In Textfields Without Disabling Links
ive created a custom cursor using mouse.hide but have been unable to figure a way to stop the hand cursor from showing up when you roll over a link in the htmltext of a textfield.
i've tried disabling mouseEnabled, usehandcursor, and disabling the parent mc's mouseChildren and buttonMode, but none seem to work without disabling the html links themselves.
has anybody experienced the same problem or possibly solved it?
Thanks in advance.
Var A:Item = New Item("Business", "+", Textsize, Color, Alignment)
Hi all,
I am new to AS3 and have spent a few weeks to figure out how to create a class which have 2 TextFields - the first textfield is either a "+" or " " and the second one is some text ... Since there are over 50 items, I think it will be good to create a class instead of using symbols in flash. I need to adjust the font size, font color, alignment, rotation inside the class.
Example :
var a:Item = new Item("Business", "+", textsize, color, alignment,rotation)
I have the following code which works in timeline but don't know how to put it in a class...
Can anyone help me out... Thanks in advance !!!
--------------------------------------------------------------------------------------
var element01:Sprite = new Sprite();
addChild(element01);
var cFont:String = "Arial";
var cTitle:uint = 0x999999;
var cContent:uint = 0xc4b789;
var cContainer:uint = 0x7c7f4f;
var c12:uint = 12;
var c10:uint = 10;
var myFont:Font = new EmbedArial();
var txtFmt_gContainer:TextFormat = new TextFormat();
txtFmt_gContainer.font = myFont.fontName;
txtFmt_gContainer.size = 24;
txtFmt_gContainer.font = cFont;
txtFmt_gContainer.color = cContainer;
txtFmt_gContainer.size = c10;
txtFmt_gContainer.align = "right";
var item:TextField = new TextField();
item.autoSize = TextFieldAutoSize.LEFT;
item.defaultTextFormat = txtFmt_gContainer;
item.embedFonts = true;
item.text = "business";
element01.addChild(item);
item.x = 10;
item.y = -10;
item.rotation = -8;
var sign:TextField = new TextField();
sign.autoSize = TextFieldAutoSize.LEFT;
sign.defaultTextFormat = txtFmt_gContainer;
sign.embedFonts = true;
sign.text = "+";
element01.addChild(sign);
--------------------------------------------------------------------------------
Florence
Load Xml Data(list Of Names), Use List As Buttons In Flash Possible?
Hi, basically I have a quiz game that I made, the quiz is done but I want to keep track of how many times a person has failed the quiz. I have an XML file that has a list of names. I want to take those names, put them in a quiz game (at the beginning) as a "list" of some sort and let the user be able to choose their own name (which is of course already in the XML file). This name will be used to keep track of how many times they have tried the quiz.
I have successfully loaded the XML file (names) into an ARRAY in Flash but how can I output them to the screen AND let the user be able to choose those from the list? as a button? This will add the count after they clicked their name to +1 and then save it to somewhere(where is best?). I will attach the zipped files (there are 4, the fla,swf,2 XML files[quiz/names]). If anyone can help me ASAP it would be awesome.
Separate The List Items With The Separator And List Is Dynamic
Hi,
I am getting the list items dynamically ,and hv to draw a separator after the every group of list items.For this I have to embed a script function after every group.How can i do this Actionscrip 3.0 Any help?
Ex:
Group 1:
ABC
DEF
GHI
TODO-----Here we need to draw a line
Group 2:
123
456
789
TODO-----Here we need to draw a line
Group 3:
abc
def
ghi
Here I have da code:
for each(var group:XML in event.responseMessage.rawXML.group)
{
var pageSection:PageSection = new PageSection();
pageSection.text = group.@name;
pageContents.addChild(pageSection);
trace("***********Group Name: "+group.@name);
// once the section has been added, iterate through it's children and render each field.
// for each(var field:XML in server.currentPage..field)
for each(var field:XML in group.field)
{
var formElement:FormElement = AppCode.FieldRenderer.renderField(field, pageSection);
/* check for null, if for some reason we encounter an unknown control type
* the formElement will not be instantiated so we should skip over it.
*/
if(formElement != null)
{
/* formElement.field = field;
pageSection.addChild(formElement); */
formElement.setRuleDetails = this;
formElement.communicator = this.communicator;
if(event.responseMessage.pageType == PageType.UPDATE || event.responseMessage.pageType == PageType.ADD )
formElement.readOnly = false;
fieldList.push(formElement);
}
}
//Add Separator b/n groups
TODO...Here we need to call a function which draws a line.....}
Plz help me if u have any idea?
Debug > List Objects + List Variables ...
I am testing my flash movie within the flash application. I go up to the toolbar while testing and select 'Debug > List Variables' and then 'Debug > List Objects'. This displays all the variables and all the objects in the trace window. Fairly straight forward!
What I want to do is access these variables and objects at runtime while viewing my flash movie within the browser. So I can make a text field in my movie and populate it with these variables and objects BUT how do I access these from the flash movie ? There must be a way to get the output from 'Debug > List Variables' and 'Debug > List Objects' at runtime and dump it all into a text field on screen.
Can anyone assist please,
Thanks,
Stephen.
Converting Bulleted List To Numbered List
I'm trying to put out a list of questions for a test. I'm also using a stylesheet to format the way the text is displayed. This is the way the list should look like:
1. question#1 text.............................................. ......
2. question#2 text.............................................. ......
If more than one line of text per question, it continue on the next line indented. The text for each question needs to be looking like a block of text. The same way a bulleted list displays.
This format can be created by using the <ol>, <li> tags in HTML. But Flash doesn't recognize any style formats for the <li> tag. Only a bulleted list is printed out. How can I format that list into a numbered list? or if not how can I create the same output, keeping in mind that I have to use a stylesheet? Thanks.
Debug > List Objects + List Variables ...
I am testing my flash movie within the flash application. I go up to the toolbar while testing and select 'Debug > List Variables' and then 'Debug > List Objects'. This displays all the variables and all the objects in the trace window. Fairly straight forward!
What I want to do is access these variables and objects at runtime while viewing my flash movie within the browser. So I can make a text field in my movie and populate it with these variables and objects BUT how do I access these from the flash movie ? There must be a way to get the output from 'Debug > List Variables' and 'Debug > List Objects' at runtime and dump it all into a text field on screen.
Can anyone assist please,
Thanks,
Stephen.
(Flash MX Or 8) List/List Component Issues
Hello all.
I recently completed Kirupa's "Creating a Listbox" tutorial, (http://www.kirupa.com/developer/mx/listbox.htm) but have been having a difficult time modifying the event attributes of each list item. Basically, I want to click on an item and have an object on the stage move to a unique xy coordinate. I can get the object to move already (object._x = object._x +10, but unfortunately ALL items on the list execute this script command. I've tried fooling around with the code to get each item to do a unique movement but...well, clearly I haven't succeeded yet.
I'm a Flash nooby and help in the form of specifics would be greatly appreciated. If you can provided modified code from the tutorial to move an object to a unique positions that's even better.
Thanks.
David
List Component. Help. Looked Everywhere. Button And List.
Trying to use a list component and a button. When user selects something from list component and clicks button it takes them to new page, if user doesnt select something from list and hits button, (this is where my question lies) I want it to do nothing and setFocus to list component.
Here is how I am going about it now: New if statement (however it still transfers user if nothing is selected from list component) How can I get it to not transfer? I have tried rewritting this many ways, searched all over the nets, and Nada.
Code:
var arUrl:Array=["/browsecategory.aspx?cat=1","/browsecategory.aspx?cat=2","/browsecategory.aspx?cat=3","/browsecategory.aspx?cat=4"];
var provider:Array=[{label:"Option 1",data:0},{label:"Option 2",data:1},{label:"Option 3",data:2},{label:"Option 4",data:3} ];
mcList.dataProvider=provider;
var obj:Object={};
obj.click=function(eo:Object)
{
var count:Number=mcList.selectedItem.data;
getURL(arUrl[count],"_blank");
trace("count="+arUrl[count]);
}
but.mcSubmit.addEventListener("click",obj);/////here is where I am sending off
if(mcList.selectedIndex == undefined) {
setFocus.mcList;
}
So this thing works perfectly, however if user hasnt selected anything how can I get it to not transfer and setFocus?
I have tried setting if to check it for - 1 (since starts at 0) set to 0? Any ideas please help. Thanks in advance MT
'list' Event Of List Component
oops i mean 'change' event of list component
Hi guys/gals. Ive made an xml/list component driven mp3 player as can be viewed at http://www.flashmatics.co.uk/blog/sa...mp3player.html
When someone selects a new song from the list that songs starts to play. Everything is working fine.
I now want to add an extra bit of functionality i.e When one song finishes i want the next song to start playing. But this means I have to tell the list component that a change has occured as well (even though there has been no user interaction to cause this 'change'). How would I go about this. Here is a snippet of relevant code.
Code:
mySound.onSoundComplete = function():Void{
//from here i need to tell the component a change has occured and to move it
//to the next song in the menu
}
//create a listener for the list component
var compListener:Object = new Object();
list_comp.addEventListener("change", compListener);
compListener.change = function(info:Object):Void{
//how do i get this to move to the next track?
}
Thanks for any help in advance. I dont actually need the whole code or anything but rather a point in the right direction..cheers
HELP Symbols List To Text List?
Is there a way to get a list of all the symbols in the library into a text file quickly and easily?
Thanks in advance!
-Ted
|