ActionScript 3.0 :: Displaying Array In Two Columns?
Mar 28, 2011
i have an array that generates a list of buttons. What i would like to do is split the list into two columns of 5 buttons each rather than one column of 10 buttons.I thought of creating two arrays of 5 items each, but couldn't figure out how to assign my dynamic button to the second array or set a second x/y position for the new column
Code:
public class Actions extends MovieClip {
private var off:Object;
[code]....
View 5 Replies
Similar Posts:
Feb 8, 2011
I am trying to create a menu using a for loop. I got the loop working at the data to display, but after the 3rd button I want to put the other 3 buttons to the right of the first three, if that makes sense.Right now the first 3 displays, and the last 3 are moved over where they need to be, but it's still below the 3rd one, how do I get the 4th item to line up with the 1st time on the x axis?Here is that code I am using.
var mc:MovieClip;
var yCount:Number = 0;
for (var i:int=0; i<navigation.length; i++)
[code]......
View 1 Replies
Sep 7, 2009
I have an array that looks like:PHP Code:"comp01" 50.0010.0020.003"comp02"50.0040.0050.006"comp03"50.0070.0080.009How to split (rearrange) this array into three columns? (for example):
View 3 Replies
Jan 11, 2010
I want to save remotely (on a database) the state (visible columns, columns width and order) of a Flex3 DataGrid.For width and visibility I can simply save them by accessing each column attribute.. But for the order? Do I have to create the dataGrid dynamically?
View 2 Replies
Mar 1, 2009
I need to create a multidimensional array with a certain number of rows/columns from variables that store the number of rows/columns. For example say I have:
var r:int = 5;
var c:int = 10;
I want a multidimensional array that has 5 rows and 10 columns, every space within the array filled with the value 0.
View 2 Replies
Mar 28, 2009
I'm new to AS3, but our teacher thinks we're all amazing geniuses and assigned us this project which was due last class. Great, I know, I have to do it even if it's late. Only 5 students out of 28 were able to finish the assignment.[code]Those are all the assignment details he gave us.All I have so far. What I have only adds the array to the list. Nothing much else.[code]Also, when the array prints on a new line, the prior item on the array must not print as show above.
View 6 Replies
Sep 8, 2009
I'm getting the following error in my compiler when I run this, even though it does exactly what I want it to do.
Quote:
TypeError: Error #1010: A term is undefined and has no properties. at boxes070909_fla::MainTimeline/drawboxes()
I'm more interested in understanding why the error is occurring and how to correct it, than rewriting the code in a way that I don't understand it anymore.(Which was my friend's solution)
box_mc is an 80x80 grey square movieclip, of class Box.
ActionScript Code:
var i:Number=0;
var j:Number=0;
var totalColumns:Number=5;
var totalRows:Number=5;
[Code].....
View 3 Replies
Jul 16, 2009
i defined a global array in the first frame.When the user clicks on a button a value is inputted into the array, and they can click on several so all the different values are stored in an array.I want to display the last value of the array, so the last button they clicked on, on a separate frame.so i define my array like:
_global.purchases = new Array();
and the code on my button is:
on (release){
_global.purchases="awhite";
_root.gotoAndPlay("checkout_page");
}
and the code on the frame with the text box is:
var arrayCount = purchases.length;
var latestValue = arrayCount-1;
if (purchases[latestValue]=="awhite"){
imagename_txt = "A White";
}
However, the text doesnt display at all. If I trace my array then I get "awhite". If i trace arrayCount I get "6" and "5" for latestValue. But if i try and trace purchases[0] then I get "undefined".
View 5 Replies
Jul 16, 2009
i defined a global array in the first frame.When the user clicks on a button a value is inputted into the array, and they can click on several so all the different values are stored in an array.I want to display the last value of the array, so the last button they clicked on, on a separate frame.so i define my array like:
_global.purchases = new Array();
and the code on my button is:
on (release){ _global.purchases="awhite"; _root.gotoAndPlay("checkout_page");}
and the code on the frame with the text box is:
var arrayCount = purchases.length;var latestValue = arrayCount-1;
if (purchases[latestValue]=="awhite"){ imagename_txt = "A White";}
However,the text doesnt display at all. If I trace my array then I get "awhite". If i trace arrayCount I get "6" and "5" for latestValue. But if i try and trace purchases[0] then I get "undefined".
View 1 Replies
Aug 20, 2011
I am trying to display few data from a PHP (which communicates with a second php that uses a database) into flash.I have created the code needed, but when tracing the php I get "Array" as a result of the trace. How can I display the data that is inside that php array into flash?
View 2 Replies
Feb 9, 2011
Say I have: public var usersOnlineArray:Array = new Array(bob,jim,tim,marry,luke);
and when i put that into my datagride like this:
buddylist.dataProvider = new DataProvider(usersOnlineArray);
buddylist.rowCount = buddylist.length;
bldBuddyList(buddylist);
how could i, lets say prevent luke from appearing in the data grid? basically make him not appear but technically "still be there" so i can make him reappear later but?
View 2 Replies
Jul 16, 2009
i defined a global array in the first frame.When the user clicks on a button a value is inputted into the array, and they can click on several so all the different values are stored in an array.I want to display the last value of the array, so the last button they clicked on, on a separate frame.so i define my array like:
_global.purchases = new Array();
and the code on my button is:
on (release){
_global.purchases="awhite";
_root.gotoAndPlay("checkout_page");
}
and the code on the frame with the text box is:
var arrayCount = purchases.length;
var latestValue = arrayCount-1;
if (purchases[latestValue]=="awhite"){
imagename_txt = "A White";
}
However, the text doesnt display at all. If I trace my array then I get "awhite". If i trace arrayCount I get "6" and "5" for latestValue. But if i try and trace purchases[0] then I get "undefined".
View 4 Replies
Sep 6, 2010
I'm trying to get values of an array to display into a single text field but I'm also trying to bold the first few letters dynamically using the setTextFormat() method.Basically trying to achieve what the google search function does when it comes up with auto suggestions and each keyword gets un-bolded.
View 0 Replies
Sep 11, 2010
i have two different library objects which i add to stage and have them moving around. I have no problems getting the number of all the objects on stage into one dynamic text box, but i want to have the number of each of the two different objects shown in their separate text box. When i try this code, all i get in the dynamic text-boxes, are the name of the objects.
package {
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;
[Code].....
View 2 Replies
Jul 27, 2009
I have a project I am working on and I am stuck on this. I have an array that holds songs. I want to somehow print these items out and make them buttons so that when I click on it, it will call a function. For proof of concept, i will just make my own code here and you guys can give me insight:
Code: Select all
var a:Array = new Array("song1.mp3", "song2.mp3", "song3.mp3", "song4.mp3");
Now i want this to firstly display:
song1.mp3
song2.mp3
song3.mp3
song4.mp3
I tried a for loop and a dynamic text field but that just overwrites itself. Next, it would be nice if it could add an event listener or call a function loadSong(curentSong[1]) ===with whatever position it is in the array between the brackets==
View 1 Replies
Apr 15, 2008
This sounds so simple, but its to save me doing things like this:
Code:
var Lol:Array = new Array();
Lol["Rofl"] = 0;
_root.Lol_Rofl = Lol["Rofl"]; Just to get the array value to display in a dynamic textfield, is there any other more efficient way so that I do not need to declare a seperate variable with the value of the array data to get it to display?
View 4 Replies
Aug 28, 2010
I have an array and 4 text boxes (named lane1, lane2, lane3 and lane4), and the array tells me which text box to put text in. This is my current code:
Code:
lane = ["lane1", "lane2", "lane3", "lane4"];
messageLane = ["2","3","1","3","1","1","1","1","1","1","2","3","2","1","1"];
messageLetter = ["4","4","0","4","0","2","6","0","2","0","6","4","6","5","2"];
step=0;
onEnterFrame=function(){
number1=(messageLane[step]);
number2=messageLetter[step];
lane[number1].text = number2;
step++;
}
I used an array called lane because it wasn't working without the array, but still isn't. I kept the array just because it keeps it just a bit organized. The trouble is the line:
lane[number1].text = number2;
Because lane[number1].text isn't recognized as a text box, well not a text box with the same name as I want at least... Each four text boxes do not show anything?
View 4 Replies
Apr 11, 2005
I'm trying to create something that will load a bunch of images into an array and then be displayed whenever needed via using the attachMovie() function.
Code:
for (var i=1; i<list.length; i++) { //list is an array full of urls to images
_root.createEmptyMovieClip("img"+i,i);
loadMovie(list[i], "_root.img"+i);
}
I dont think this is what I want because I don't actually want the images to appear right here (this is the loading part). What I want is each image to be in a separate symbol with a unique identifier so that I can create them dynamically during runtime.
View 1 Replies
Mar 9, 2011
I have a variable call php_variable that loads from the php. It echos all the necessary variables. I have 2 array, Tel_start and Tel_area. The messages.text is just a text field I use to test if things are loading properly.
[Code]...
It display the correct string. But when I use Tel_start[0] like above, I got undefined. So here, the actual quesetion, what's the proper way of storing those variables and displaying it?
View 9 Replies
Oct 7, 2010
My data grid is displaying stale data, rather than the real time data available in it's data provider (array collection). I've tried refeshing the data in the collection, but that has no effect. Below is my code, does anyone see what could be the problem?
<mx:Accordion/>
<fx:Script>
<![CDATA[[code].....
View 4 Replies
Jul 13, 2009
<local:CheckBoxDataGrid id="dg"
allowMultipleSelection="true" x="118" y="151" width="557">
<local:columns>
<mx:DataGridColumn dataField="firstName" headerText="Select" width="50" sortable="false" itemRenderer="CheckBoxRenderer" >
</mx:DataGridColumn>
[code]....
I am getting the values as ArrayCollection, but when i bind it to my Datagrid, i am not getting any values.... though the objects returned from PHP are fine.
View 2 Replies
Dec 8, 2005
PHP Code:
var i:Number = 0;
function goMe(){
if (i >= myArray.length){
[Code]....
i'm using this code to cycle through an array and move the movie clips to x:0, and y:height of clip, times whatever number it is.... if there are 4 objects in the array, object 1 would be 1 times it's own height.... etc... so they're spaced out.
however, when i resize my stage, i'd like to have them arrange differently... into columns... but i'm not sure how to specify breaking them off into columns. i tried something like this:
[Code].....
View 1 Replies
Apr 14, 2009
I am having a lot of trouble figuring out how to dynamically display 3 columns of text in my swf. They are somewhat long lists of song/album/label titles and all 3 columns need to scroll as one unit. My client gave me Excel files with the lists in spreadsheet form. I've tried exporting as XML and HTML. I've gotten the lists to disply in my SWF using dynamic text boxes but now I can't figure out how to get all 3 text boxes to scroll as one.
Is there a way to create a simple table in Flash and have each list load into Column1, Column2, and Column3 and then attach a srollbar to the table?
View 4 Replies
Sep 30, 2008
I have a single text field that attaches numerous lines of text. Because each line has an individual hyperlink, I'm using += and a for loop to append the next line. Here's the problem... When the text reaches the bottom it keeps going past the viewable area instead of becoming a new column - obviously by default. I know I can use scroll bars and all that mumbo jumbo, but having several columns is the way the client wants it.
View 3 Replies
Jul 28, 2011
I have a datagrid that uses a custom cellrenderer class to allow me to use a combobox. I have an invisible column that holds the value returned by the cellrenderer when the combobox value is changed. BUT sorting is wonky. Since what really lives in the combobox column individual cells is an object, it never really sorts properly. Is there a way to fire a sorting event to the column that holds the real value?
View 4 Replies
Mar 19, 2012
in my AS3 Datagrid, I'd like the columns would not be reorderable by clicking at their top.Now it appears the datagrid that represent a players' classification.Now if I click at the top of every column, the reorder as like they want.
View 1 Replies
Nov 12, 2009
How do you make a List control wrap around to a second column (or multiple columns)? let me know if there is a solution for this with the List control or some other Flex control.
For example, if you have one list with 42 items in it, but I want to cap the height of a list to 20 items; then instead of having one list with 42 items all the way down, I would have that list of items look like the equivalent of 3 adjacent lists: the first with 20 items, the second with 20 items, and the third with 2 items (which represent the original list of 42 items). [url]...
View 6 Replies
Dec 3, 2009
On a DataGrid, setting alternatingItemColors will apply the color scheme to all of the columns of that grid. I'm looking for a way to define different alternating colors for each column.
View 2 Replies
Nov 21, 2010
I'm using the following code to load XML directly into a datagrid:
import flash.events.Event;
import fl.data.DataProvider;
import flash.net.URLRequest;[code]....
How can I reorder my columns based on the title?
EDIT:My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<contacts>
<contact first="Moshe" last="Doe" address="555 5th St" city="Somwhere" state="AA" zip="555555" phone="555-555-5555" />[code].....
View 1 Replies
Mar 15, 2011
I'm making an application where I display an AdvanvedDataGrid with one column with dates(in format DD/MM/YYYY) and another with datetimes (in format HH:MM). I'd like to sort dates according with the datetimes as well(just clicking in the header of the column), there is an examplen of the expected behaviour:
02/02/2011 | 10:42
03/02/2011 | 09:45
02/02/2011 | 11:45
03/02/2011 | 11:30
[Code]....
_currentDatosBusqueda is an arraycollection I receive from the Server (with the correct format of dates and datetime).
View 2 Replies