ActionScript 3.0 :: Selecting From An Array?

Jul 21, 2009

I have this file [URL] with this code

Code:
import gs.TweenLite;
import gs.easing.*;
//Roll over and out button actions
var buttonArray:Array =

[code]....

1. Rather than using removeChildAt(5) how can I change this so I don't have to hard code in a number? As when I use this in my main project I get an out of bounds error.

2. How do I get my store text to match the pin that has been rolled over, so if pin 1 has been rolled over I get store one etc. At the moment I only know how to say storesArray[0]; which obviously isn't working for me.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Selecting Last Array Only?

Nov 8, 2009

I have a tower defence that i am making, and what i am trying to accomplish is to upgrade the tower selected, but it is only upgrading the last tower built. Here is my upgrading code:

ActionScript Code:
function everything() {
for (l=0; l<dtn; l++) {
dartSelected = dartTowerForReal[l];

[Code].....

View 0 Replies

ActionScript 2.0 :: Selecting Values In Array In Listbox?

Jul 27, 2005

I suppose to load a xml into flash n convert it into an array. After which im suppose to place them in listbox so that ppl are able to select them to view different stuff. Apparently, im unable to get the selected value of the listbox. With this, the users cannot select n the whole thing doesnt work. With array, im suppose to use getSelectedItem to get the value.. but it always ends up in a error "[type function]"

Code:

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("../XMLs/features_index.xml");

[code]....

View 1 Replies

ActionScript 3.0 :: Selecting A Random Movie Clip From Array?

Mar 7, 2010

I know this should be easy, but I can't seem to make it work. All I want is for the variable currentPage to select randomly from an array so that every time the page loads, it displays a different currentPage. This is what I have so far:

var myImages:Array = new Array("outsource_mc","solutions_mc","staff_mc");
var randomImages:Array = [];
var randomCount:Number = 1;
var r:Number;
for (var i = 0; i<randomCount; i++) {

[Code]...

View 6 Replies

ActionScript 3 :: Flex Tree Does Not Selecting Array Of Items (Highlight)

Nov 5, 2011

I have an array of items that should be selected in my tree control. As you can see from my code below, I bind this array to the selectedIndices property of the tree. The selected Items are not properly selecting in tree(selecting some other items and always root is selected).Flex seems to "ignore" my items (selects some other indices).

My XMLList:-
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<fx:XMLList id="XMLList">
<node><node name="max">
[Code] .....

View 1 Replies

ActionScript 3.0 :: Selecting One Letter From A Word Array (to Start Off A Word Game)?

Jan 2, 2012

I have been building a simple word game. It is smple but works fine. I am now trying to enhance some of the features.I would like to see if I can display one letter of each word so the Player has a hint. Think of this as a beginners level.The words are random from a text list. Either I can make the letters invisible and the game starts without a hint or I am able to select a letter using charAt() or creating a new variable substring()from the word which is the displayed repeatedly on the stage(not what I want) I have not been able to find a way to display one letter and display it in the correct order within the word and keep the remaining letters invisible.
 
import flash.net.URLLoader;
import flash.events.Event;
import flash.display.MovieClip;
import flash.text.TextField;

[code]...

View 6 Replies

ActionScript 2.0 :: Putting Data Into An Array Via XML And Then Selecting At Random An Image String To Load In A Pic At Random

Feb 11, 2009

I've been putting data into an array via XML, and then selecting at random an image string to load in a pic at random. But whilst doing this, I wanted to remove the String from the Array that I have just used, so I don't get repetition of the same image in the output. I initially thought that pop would remove the string I had just used - But of course it Removes the last value in the Array instead, which doesn't really help.

Ok - so how about randomizing the data once inside the Array, after it has been pulled in from XML!? That way I can load in the 'last' image, and then pop it out! Keeping a randomized selection of images each time 'it' is loaded

View 2 Replies

ActionScript 2.0 :: Selecting Some Items Together?

Apr 29, 2009

am creating a little game... It is about selecting some items...If 2 right items are selected on frame 1, the "next" button will appear for the user to click on it to go to frame 2.

View 1 Replies

Selecting New Layer In Flash?

Jul 4, 2010

When you add a new layer to flash it shows you that little black ball on the first frame.now when I add a new layer into flash it only shows an empty ball in the first frame, it's not filled with black. how do i fix this?

View 2 Replies

Flash - Selecting Technology For Web App

May 21, 2011

I want to develop an app, which will have a GUI, and will do real time processing of user input. App should work in most common web browsers, and processing will be client side. Also, the app must only work if user is online and logged in to my website. Something like a "license". People should not be able to hack/reverse engineer the code etc. Is it possible to do what I want using Java Applet or a Flash application? Any other technology?

View 1 Replies

ActionScript 2.0 :: Selecting First Value In Combobox

Oct 26, 2009

I'm using a combobox component that I'm populating with a five-element array, as follows:

0 All
1 Bakery
2 Diary
3 Deli
4 Drink

And because I don't want "All" displaying in the text box, I've added the line

dropDown.text = "Select here..."

once the combobox is populated. Unfortunately, when I test the combobox and open the list, "All" is at the top of the list but already selected, so that when I click it, nothing happens. The rest of the items work fine.

Could someone tell me how to disable the first item, so that it's not automatically selected when the list opens and therefore can be clicked?

View 1 Replies

ActionScript 3.0 :: Selecting Right Data From XML

Sep 13, 2010

I'm trying to create an gallery application that reads the pics from the server per category (= directory). I do this using a PHP that creates the XML file:

HTML-code:
<?xml version="1.0" encoding="utf-8" ?> - <categories> - <category name="Categorie1">
<image name="cat1Pic1.jpg" /> <image name="cat1Pic2.jpg" /> </category> - <category name="Categorie2">
<image name="cat2Pic1.jpg" /> <image name="cat2Pic2.jpg" /> <image name="cat2Pic3.jpg" /> <image name="cat2Pic4.jpg" /> </category></categories>

Now I can get to the categories(= directories) using this code:
ActionScript 3 Code:
var categoryAttributes:XMLList = galleryInput.category.attributes();
for each (var categoryNAME:XML in categoryAttributes){
trace("categoryNAME:" + categoryNAME);
}

This works, I get the directory names and create labels on stage and hang eventlisteners on them to handle user input. The next step is to select the corresponding pictures (that are in the "current" directory) and I just can't get it to work. My best effort so far is the following, but this code gives me ALL pictures, not a selection....

ActionScript 3 Code:
var categoryAttributes:XMLList = galleryInput.category.attributes();
for each (var categoryNAME:XML in categoryAttributes) {
trace("Hier komt de categoryNAME:" + categoryNAME);
// Get the right pictures
[Code] .....

And if I use galleryInput.category.image.name AS3 states that there are more than one value (of course). Now I have 2 questions: How do I limit the selection to just the images belonging to the "current" category? Is this the right approach? Or should I design it all different?

View 1 Replies

Scale Entire Document Without Selecting Everything?

Nov 6, 2009

I've stupidly made a flash document with the default 550x400 pixels and I now need to scale all the content (buttons, MC, dynamically loaded images)

Is there an easy way to do this without selecting everything (problematic by the way) and using the transform tool?

View 2 Replies

ActionScript 3.0 :: Display Different Movieclips Selecting Them By Name

Dec 28, 2010

I have around 40 mcs I want to use as buttons, how can I do something like this:

var mc:MovieClip;
for (var i:Number=1; i<=40 ; i++){
mc = MovieClip(MovieClip(root).getChildByName("m"+i));

[Code]....

Right now, when I roll over any of those mcs, always the last is working.

View 2 Replies

Selecting Colors Via Toolbar Swatches

Jun 8, 2009

In coloring an object using the toolbar fill palette, I'd like to simply be able to double click on the color swatch in the toolbar, rather than click on the swatch and mouse down to the color and click again with the eyedropper. What's happening is that the color swatch in the toolbar contains a variety of colors around the one that it nominally represents. e.g. If the swatch is ff0000, double clicking on the swatch is likely to color the selected object anywhere from f30000 to fe0000 depending on precisely where in the swatch you double click.

View 1 Replies

Professional :: Selecting One Frame In The Timeline?

Jan 28, 2010

somehow I switched the setting for selecting some frame in the timeline. I was used to click once and have one frame selected. Now it selects the whole time of a keyframe when I click on it not just the frame I clicked on.
 
how I can set it back how it was?

View 2 Replies

Flash :: Selecting Regions Of Image?

Jun 10, 2010

I am trying to write a flash app that will allow a user to select various regions of an image, similar to that of the selection tool in photoshop where a square region can be stretched and selected.
 
Would anyone have any ideas or tips for me that could get me going in the right direction? I have been researching for tools to help me write this but haven't been able to find anything useful..

View 5 Replies

Flex :: Selecting Id Of TextArea (despite RichEditableText)

Jun 17, 2010

I'm trying to select the id of a textArea when it's focused in

[Code]...

Problem is TextArea is made up of RichEditableText so target doesn't actually refer to TextArea. I've tried event.target.parent.id but still not getting there. Anyone knows how to get to the bottom of this?

View 2 Replies

Flex :: Selecting One Particular Data Item?

Jul 9, 2010

I've created an Flex app. It currently has an drop down menu. With the option to select a Channel. Once the channel is selected the data pulls through. But, what I want to do is just pull through one channel of data as opposed to multiple items of data. How can I achieve this?

My code is quite simple at the moment and looks like this :

<mx:FormItem label="Select your Channel : " x="296" y="0">
<s:DropDownList id="channelSelection"
dataProvider="{channelList.lastResult.channels.channel}"

[Code].....

View 1 Replies

Flex :: Selecting One Particular Data Item From XML

Jul 12, 2010

I've followed the Flex in a week example, with the drop down menu that pairs the XML data to the XML node set.For the project I am creating, I am just pulling through ONE XML file containing just one node into my application.I am using HTTPService and pulling the data through, but at present the only way for this to work is by using the <s:DropDownList>[code]

View 1 Replies

Flex :: ArrayCollection - Selecting Value From ComboBox

Sep 22, 2010

My goal is to create a generic function that selects a value in a combobox according to a value. (My comoBox holds arrayCollection as dataProvider.) The difficulty is infact to get a propertyname in runtime mode.

public function selectComboByLabel(combo:ComboBox , propetryName:String, value:String):void {
var dp:ArrayCollection = combo.dataProvider as ArrayCollection;
for (var i:int=0;i<dp.length;i++) {
if (dp.getItemAt(i).propertyName==value) {
combo.selectedIndex = i;
return;
}}}

The line if (dp.getItemAt(i).propertyName==value) is of course incorrect.
It should be arther something like: dp.getItemAt(i).getPropertyByName(propertyName)

View 2 Replies

Actionscript :: Selecting The Random Variables?

Feb 16, 2011

Is it possible to randomly select from variables in action script?I have tried using or -

question.text = question1 || question.text = question2;

View 2 Replies

ActionScript 3.0 :: Selecting Xml Items By Keywords

Sep 29, 2009

I'm trying to build a portfolio gallery.I have it set up so that the user gets all my portfolio items to start with and then at the top right there is a comboBox that allows the user to select "programs", "code" and "clients" this changes the left vertical tileList to only show icons of the programs or of codes etc.I'm trying to get it so the user clicks on one of the program icons or whatnot and it then limits the thumbnails in the tileList on the bottom of my widget.The thumbnails come from a xml document that has the images and then <keywords>.Inside this node is a list of the programs and codes used.I tried using indexOf and then a if statement to check if indexOf was -1.But that didn't work.[code]

View 2 Replies

ActionScript 3.0 :: Selecting Items From An Inventory

Dec 9, 2010

So you start off with all of the items in the inventory. You do not have to collect them.I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.[code]I thought this. called on every movieclip of the Rebound class?So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.

View 1 Replies

ActionScript 3.0 :: Selecting An Item On The Stage?

Jan 13, 2011

Im going to have multiple items in this game im making, and i want these items to be selectable. And i would have to be able to trace which was was currently selected.

View 1 Replies

ActionScript 3.0 :: Dynamically Selecting A Movieclip?

Apr 20, 2011

I'm trying to dynamically move the desired MovieClip depending on how many times the right or left button is pressed.

I've written this:

nml:Number = numpos + 2;
nmr:Number = numpos - 2;
var nmlm:MovieClip = panels.panel(nml)

[Code]....

View 9 Replies

ActionScript 2.0 :: FL8Pro : Selecting Key On Keyboard?

Nov 28, 2006

What is the actionscript for selecting a key on the keyboard such as 'down' arrow, and the movieclip moves to frame 60?

View 4 Replies

ActionScript 3.0 :: Selecting Items From An Inventory?

Dec 9, 2010

So you start off with all of the items in the inventory. You do not have to collect them.

I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.

What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)

it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.

but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.

here's the class

Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;

[Code]....

I thought this. called on every movieclip of the Rebound class?

So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.

View 1 Replies

ActionScript 3.0 :: Selecting First Item From Listcomponent

Aug 18, 2009

I've written the following code to load images in a datagridcomponent by using a listcomponent. What code do i use to automatically select the first item.[code]

View 2 Replies

IDE :: Selecting Publish Flash Version?

Sep 18, 2009

I've just got back to webbydesign and Flash after a long break! I'm bit concerned about the fact that many public computers do not have updated Flash player in their browsers and therefore can't show content designed with CS4 correctly, or at all!

I can't check this myself right now, but if I select ie. Flash version 8 in publish settings using Flash CS4, will this disable all version 10 functionality while designing my site? As far as i know, v10 supports 3D and whatnot fancies, that I don't need atleast for now.

View 1 Replies







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