ActionScript 2.0 :: Arrays & Grids/Lists - Incrementally Move Items Up And Down?

Dec 20, 2006

This is probably one of several ways to do this..."myData" is an array that contains information displayed in "myDataGrid". "toBeMoved" is a variable containing, um, the item to be moved.

btn_up.onRelease = function() { // this is a button to move items UP in the list

whoseSelected = myDataGrid.selectedIndex; // gets the index # for the selected row/item
if (whoseSelected > 0) { // makes sure you dont have the already top item selected
toBeMoved = myData[myDataGrid.selectedIndex][code]...

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Lists And Arrays - How To Tie Name To Number

Jun 30, 2009

What I have are basically two lists.
(using this one as an example)
Bear = 5
Cat = 3
Dog = 1
Bird = 2

And I have two corresponding arrays
Array1 = [5, 3, 1, 2]
Array2 = [Bear, Cat, Dog, Bird]

How can you reorder this by number? I know that you can use Array.sort, but how would I still be able to tie the name to the number? Like, if you use the sort method, it will give you [1, 2, 3, 5], but the other array would still be [Bear, Cat, Dog, Bird]. How could I make it so it ends up being [1, 2, 3, 5] and [Dog, Bird, Cat, Bear]? I was thinking of making something like [[Bear, 5], [Cat, 3], [Dog, 1], [Bird, 2]], but I'm pretty much stuck after that...

View 5 Replies

ActionScript 3.0 :: Any Control Lists Items And Can Edit The Item?

Oct 29, 2010

is there any control that lists items (like s:list control) and also allows to edit the item ( like mx:ComboBox )?

View 0 Replies

Flex :: Resize Nested Mx:Lists To Display All List Items?

Aug 17, 2010

I'm trying to create a nested list in Flex which will dynamically resize to display all children when the data provider changes.

Here's a simplified example which illustrates the problem:

<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;

[Code].....

The list sizes remain static when items are added.

If I add variableRowHeight="true" to the outer list then the inner lists will correctly resize. But the outer list itself remains at a fixed size.

How can I have both lists resize automatically to display all children?

View 1 Replies

ActionScript 3.0 :: Add And Remove Items By Comparing 2 Arrays

Apr 17, 2011

I have two arrays of objects. Each object has a unique name property besides few others. One of the array is a local copy and the other one is sent from server after regular intervals. The local copy of arrays is then used to add a movieclips into a container.Now, I want that when I receive an array from the server, I compare it with the one which is already with me locally such that the items which were not in the received array but were there in the local array, get removed from the container and the newly added ones only get added. The items which were present in both local and remote array remain as it is.

View 2 Replies

ActionScript 2.0 :: Getting Flvs To Play Incrementally?

Jan 2, 2007

I am having trouble getting my flvs to play incrementally. I can only get it to play the last flv in my array.

Code:
_root.stop();
//
vidList = new Array("item_overview_ae476x264768K.flv",

[Code]....

View 4 Replies

ActionScript 3.0 :: How To Draw Dynamic Line Incrementally

Nov 22, 2009

I am trying to implement an object which is basically a simple line which grows in length over time. Picture it as starting from y= -10 and shooting down to y = 300. I want to be able to send them down at varying angles. I have already implemented and it works but I was wondering if there was a better method than what I use. Basically, I have a MovieClip which is a straight line and when I create an instance of it I give it a random rotation value between 1 & 10 and a random X location of 50-450 and y set to -50. Then I simply use the enterframe event to increase it's ScaleY by 0.01 each time. It works but the lines do look a little blurry.

View 6 Replies

ActionScript 2.0 :: Move A Clip By Referencing Arrays?

Jan 25, 2010

I have clips on stage named: bean_1,bean2, bean3.I have an array to reference the clips: moveBeansArray[bean_1,bean_2,bean_3]I have an array that stores _x co-ordinates: xPosArray[200,250,300]I then have a function to move a clip via a flag variable: movebeans.[code]

View 6 Replies

ActionScript 3.0 :: Using Multidimensional Arrays - Correct Move Onto The Next Level

Sep 27, 2011

I may be confusing myself as I seem to do this whenever working with multi-D arrays... but perhaps you guys can set me back on the right track. I'm working on a flash application that is kind of a game. It's a memory test consisting of 10 blocks, it is very similar to the one shown in the video below.... but there are some differences where this one wouldn't for my situation. (apparently I can't link) The title on youtube is Spatial Span... it will be the first result if you search for "Spatial Span" The difference is that there are 2 sets to every level and you only need to get 1 correct to move onto the next level.

[Code]....

View 0 Replies

ActionScript 3.0 :: Make Items In A List Move Infinitely?

Mar 11, 2009

I have an MC that is a giant text box that contains 20 different items laid out vertically, like this for example[code]...

I want to make the list infinitely moveable/draggable on its y position, meaning the user can drag this list up and down but the list never ends.....In other words when the user drags to the last item in the list, the list, the list starts over again. And the same works in the reverse; if the user is dragging up and gets to the first item, the last item pops up after and then goes in reverse. In other words no ending. Think The Price Is Right Wheel or the alram clock on the iPhone or iPod touch.

View 3 Replies

ActionScript 3.0 :: Drag Select And Move Multiple Items?

Jul 4, 2011

I'm currently creating a word game where I would like to place tiles, but if possible I need it to be possible to drag select groups of tiles (preferably with a visible selection box as you drag) and move them around all together.. is there a simple way to implement this and still have the tiles snap to a grid ?

View 1 Replies

ActionScript 3.0 :: Move Multiple Items At The Same Time With Tween?

Dec 20, 2011

I wish to move multiple items at the same time with tween.

I'm currently using a loop that calls for the same tween for each item.

I then want to do something when the tween has finished using the tween listener. The problem is that it is being called each time for every item that is being moved. I know I could do some variable that changes from true to flase if its been called once, but is there a better way of doing this?

View 3 Replies

ActionScript 2.0 :: OnRelease Move MovieClip - Navigation Items

Feb 14, 2008

I am making a navigation for a site, and the client wants a box behind a menu item to show that it is the active option. He wants that box to move to behind the new option when selected. So my navigation goes along the x axis; home contact about etc. Initially the box, which I have given the instance name 'tab' is behind 'home' as its the homepage.

So by clicking on say, the third option, the box will move from home to the third option, and say the user then clicks the second option, the box is to move to behind that. I got 4 navigation items, all are buttons, all on their own layer with the box being on its own layer too (obviously below the layers for the buttons so it appears behing the menu item).

I thought it would be quite simple, have some code which effectively says:
buttom1.on(release) {
tab.moveto(x value, 40);
}

View 2 Replies

Flex :: Move Effect Only Animating Last Target In Array Of Multiple Items

Feb 5, 2011

I am animating a number of items using the Move effect. I am adding each item to an array after it has been added to the display list and once all items are added calling the play method, passing an array of the items to it. Only the last item plays in my animation.

Here is my code:
MXML: s:Move id="coinFall" yFrom="-400" duration="2000" />
public function showCoins(n:Number):void{
holder.removeAllElements();
var targets:Array = [];
if (n>=2.5){
[Code] .....

View 1 Replies

Flash :: Communication Between Two Data Grids?

Sep 26, 2011

I am trying to make connection between two datagrid in two separate windows.

Until now, I am able to create a datagrid in one FLEX browser window but got stuck furthur.

On some click event in one of 1st datagrid row-column field value, (i.e itemRenderer in form of button), I want to open a new window (using some LocalConnection or ExternalInterface.call) to open another window with the part of the original data grid.

Which method should I use - LocalConnection or ExternalInterface.call ?

View 1 Replies

ActionScript 3.0 :: Creating Grids Of Movieclips?

May 16, 2011

To illustrate what I'm trying to do I think the best point of reference would be something like the original "The Legend of Zelda" game, that is, a top-down adventure type game, with single-screen areas created using a grid of images.I'm trying to create something similar for a local charity's website, something in which the player can navigate a created area and find out about the charity by interacting with NPC staff.The environments in the above game seem to be a grid of images representing various environmental objects. Up until this point in my project I've only had to add single objects. I'd do that like this:

Code:
// add a single placeholder graphic
public var myStage:Loader = new Loader();

[code]........

View 1 Replies

ActionScript 2.0 :: Multiple Fading Grids In One Swf?

Jan 17, 2006

I need to have a series of images appear in a base FLA. The way I thought I could do it was with the Fading Grid script from the tutorials here.

I've got individual Fading Grid movies working without a problem, but when I load them into a single file one works and the other doesn't.

All the instance names are specific and it seems that when the timeline stops at the frame with all the AS one is working and the other not.

I've put three files into a folder. The individual movies and a tester FLA with the two movies in it. You can get them here!

View 1 Replies

ActionScript 2.0 :: Arrays - Close "holes" By Moving The Remaining Items Around

May 14, 2009

I have an array of say, food products. The array is full and fully visible at first. I have a filtering system, by which I can eliminate, one at a time, a certain category. So let's say that I disable the "fruits" category. The fruits disappear and I'm left with "holes" in the array. Up to this point it's all good, I can handle it. The problem is that now I want to close these "holes" by moving the remaining items around. And I have no idea how to calculate/formulate the logic of this movement.

View 4 Replies

ActionScript 3.0 :: Unable To Make Rotation And Grids?

Jan 8, 2010

I have a grid that is drawn by the graphics library. I have small pieces, let's call them blocks that are the shape of a square. These blocks connect to each other to form pieces. I want the user to be able to rotate the pieces and then snap them to the grid.I've looked at the geometry libraries but I'm unsure how I would get the points of each square in a piece to match it up with the board after it has been rotated

View 5 Replies

ActionScript 3.0 :: Create Various Grids Depending Dynamically

Aug 30, 2011

what if i wanted to create varioues grids, depending dynamically, i mean, that maybe one time there will be 3 next 4 stuff like that, and their x and y will vary to that, im recolecting data via php.

View 4 Replies

ActionScript 2.0 :: Generating Random Square Grids?

Jun 23, 2007

I'm assigned to do the portfolio section for my company's website and my supervisor has specifically told me what he wanted in terms of navigation and layout. Basically, he wants each portfolio piece to be square and in the form of 7 x 7 square grids. Each square's dimension is 100x100 px. He wants each portfolio piece to load randomly every time the page loads, so that it makes a shape of jigsaw puzzle-like if the piece is less than 49. Each image needs to be imported externally so that when we have more portfolio, we can simply added it to the array. Each portfolio piece should behave like a button that links to a bigger image.I was able to get it to the point where the squares are generated dynamically on 7x7 square grids ( I used script from "Flash Hacks" book by Sham Bingal) Now I'm trying to develop the script to get it to work like my supervisor wanted.

View 5 Replies

ActionScript 2.0 :: XML Lists?

Mar 17, 2005

Posible? like: product here..product here..produkt with extra info and so on like 1 row moreor 2 lines heheor just 1 productitem info here? Or.. as in columns?

View 1 Replies

Actionscript 3 :: Wrap Lists Into Columns?

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

ActionScript 3.0 :: SetMask - Mask All The Lists?

Jun 30, 2009

i need something in this script for make mask to all the menu now i stell don't understand why just last menu is mask i have var( i )Start from 0 to last number the menu example: last number menu is 9 so will mask just the menu number 9 i need not just to mask menu number 9 i need to all the menu menu loanding from xml and i make the script for linkage i tray so much for finish the problem for mask all but .... this is script:

[Code]...

View 9 Replies

ActionScript 3.0 :: Drag And Drop Between Two Lists?

Jul 6, 2011

I need to create the same like this: [URL]

but in flash... I am fighting all week to create this, but I've lost...

View 0 Replies

Actionscript 3.0 :: XML Lists Being Pulled Alternately?

Sep 25, 2009

I've successfully (finally) been able to pull imagery from an external XML list and display it on stage and even add it to be pulled randomly. What I'm hoping to be able to do, is after the first image comes in, using a mask bring another on top of it with a vertical blinds effect.And alternate back and forth with this technique. My thought process is two XML lists being pulled alternately? (I'm probably WAY off.) I've seen a couple templates out there, but 1. I'm a financially strapped programmer and 2. I wouldn't learn anything that way anyways.

ps. I might include the code that I have thus far in a little bit.It's nothing more than a modified version of an XML slideshow from another tutorial site.

View 1 Replies

ActionScript 2.0 :: 5 Drop-lists To Generate URL?

Apr 9, 2008

It was not for the want of trying, but I just don't think I knew where to look or what to search under, which brings me to asking the good people here. I'll try and keep it short and to the point...

I need 5 ComboBoxes/DropDown-lists/whatevers which are Item, Colour, Height, Width and Price.

And once the user has selected an item from each dropdown, and presses a button, this will generate a URL in a new window. Something like this:

[URL]

The second part of my 'question' is: Is there a way to, if the user chooses Item#1, then in the Colour list, 3 particular colours are there, but if the user chooses Item#2, then there a different set of colours to choose from?

View 2 Replies

ActionScript 3.0 :: Creating Mailing Lists In Flash?

May 9, 2009

way to create a mailing list form for the website I'm making for a model. I've looked over a number of things and I'm not finding anything that can do just what I need without alot of peripheral knowledge of PHP, Perl, etc. or being way more complex than I even need.All I'm basically looking for is a construct where there will be 3 text fields that the user can type their info into. ( name,address, e-mail ) Then there will be a send or clear button for them to obviously either change or send the data. All I'd like is for the info to be sent to an e-mail address we specify where we can retrieve it later and use it for a mailing list. I know there are a few ways this can be done. I'm just not sure if it would be better to have it be as described above - or if since I want it sent to an e-mail address, make the data into an e-mail. I've used Flash for a few years but mostly for graphics, animations and the navigational aspects of sites. I have basic scripting skills, so for me this is fun new ground, as I'd like to get better at creating the code for some user interactivity.

View 2 Replies

Flash :: Text That Lists The Tracks Done In HTML?

Sep 25, 2009

I am looking to replicate the way the music tracks are presented on this website:[URL].. I'd like to create something somewhat similar, in which I can simply type out the name of each track and then have the small Play/Pause button icon. Are there any templates that are packaged with Flash CS4 for something like this? Otherwise, if you could point me in the right direction as to how it is constructed and/or a tutorial for creating. - But is the text that lists the tracks done in HTML? If so, then this is pretty simple really.

View 1 Replies

ActionScript 3.0 :: Drag And Drop And Sorting Lists?

Jun 28, 2011

I need to create two lists called OLD LIST and NEW LIST.I need to be able to drag items from old list to new one and vice versa.I almost created these things, but I have a problem with update the items position when I drag item from list to another one

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved