ActionScript 2.0 :: Way To Organize Data Into A Hierarchy Within A Listbox?
Jan 16, 2007
Is there a way to organize data into a hierarchy within a listbox?I would like to have a parent-child list with the parent always being bold.I'm not asking someone to do it for me, I would just like to know if it can be done and maybe some direction.
I have some global Arrays defined and loaded with data at the _root level. Data is OK cause I checked it with the List Variables option. I cannot address any of my arrays from within my MC hierarchy (not from MC2, MC1 or Component MC), BUT I can address variables defined at the root level correctly?
MC Hierarchy: ComponentMC-->MC1-->MC2-->Various MCs
I placed trace(_root.MyArray[0]); at MC2 level, then at MC1 level and finally at ComponentMC level but the sentence still reads "undefined". Is there a way to actually get my Arrays data from _root ?
i want to fill a listbox with data from a MySql table. the code ive gotten working is for static data from an xml file. here it is:
var options:XML = new XML(); options.ignoreWhitespace = true; var loader:URLLoader = new URLLoader(new URLRequest("fillRegions.xml"));
[Code]....
this creates an echod file that looks just like the above xml example. so, how do i change my original AS3 code to pull data from this php file rather then the xml file?
I'm populating a listbox like this: dp.addItem( {label:"red dress", data:"OV4MP/23OL.swf"} ); Instead of data:"OV4MP/23OL.swf", I would like to make part of the data file name a variable from a dynamic textbox named centerPt that belongs to the parent movieclip, so I did this: dp.addItem( {label:"red dress", data:"OV4MP/23"+MovieClip(parent.parent).centerPt.text+".swf"} );
In lee's xml tutorial he uses the list component and the text area component but when he tested the swf he had to select the item befour the text field was populated.
i have set the selectedIndex to 0 but the data still does not load untill an item is selected.
It's a bit basic question. But, I fail to understand how to solve it. I have an application which has several enteties. E.g. pike <-- fish --> shark. Where fish is a base class.I am doing some kind of lake, so all my instances of fish class can move only within some oarders. Even more, they all are randomly created on one of the edges of the lake and swim to another depending on the edge they are located at. Here is how it looks for a base class:
public class Fish extends FlxSprite { [Embed(source="./resources/Elipse.png")]
I was wondering how MMO's such as AQworlds URL... handle maps on the stage.In my game there would be one static map per screen. The background does not move, only the player. The player can move on to the next screen by walking over arrows on the map.How would I go about storing the maps? Is it good practice to just keep each map screen as a separate object in Flash and just delete the map and make create a new map from the library when the player moves around? Should I load the maps externally? Or should I have one map object and keep each stage on a separate frame and just toggle between frames?I am not looking for code but concepts and ideas. This is my first try at making a multiplayer game and I am not sure of the "Best practices" of maps.
I'm doing a project for school and based on what was designed I'm pretty sure it will need to be done in AS3. I've got experience with AS3, for small projects I have little trouble. This project on the other hand has 3 modules which will contain 3 lessons each, and each lesson has 5 practice problems. I don't know where to start.What I've started with is a menu screen with 5 practice problem pictures on it. When I click on a practice problem picture it brings you to the appropriate problem. Upon completion of the problem it pops up an arrow that brings the student back to the menu but with previously completed problems greyed out.
I can't seem to get variables from children to work with the main actionscript that's on the first frame of the project.I've been reading Essential ActionScript 3.0 by Moock but I'm having trouble trying to apply what he's describing to the project I'm working on.I'd like to be able to figure out things like...these are my packages, these are my classes, and these are so and so. I think I can work from there
I have a menu bar that when a user mouses over it, a second menu slide out beneath it. Problem is when I move my mouse off the first menu bar, the second menu bar disappears. Im not sure how to organize my hit areas so that the second bar stays even if I mouse off the first menu bar.
I'm hoping to find out what the correct syntax is to better organize Case statements in Flash AS3. So below for example instead of having 3 case statements, couldn't I organize it somehow into just 1?[code]
I made some general useful functions for my project that I use in many different parts of the code.
I broke the code down into classes.
I can't seem to call the functions I want from each class.. right now I simply copy and paste the code of these functions into each class I need them in.
Is there any easy way to make a big file with all the general functions that are not class spesific to keep things easier?
I'm working on a small game project with some friends and I need some advice on loading files. The program initially loads an XML file which describes all of the external files needed by the various classes; images, sound clips, movie clips etc.
I would like to know how to organize a multidimensional array.Below is the current state of the array. Three rows, and a different number of columns for each.
I am working on a Color class.allow people to use whatever formats for both input and output they like.Even though the Color class only has one single value ever stored (a hexadecimal RGB value), I allow users to make a color based on any type of input, so my "static constructors" look like this, and take up a lot of room:
Code: //This isn't really how they look, but a reenactment. ;) public static function fromRGB(r:uint, g:uint, b:uint):Color { return new Color(Color.RGBtoHEX(r, g, b)); }
[code]....
... etc ... etc ... etc ... Is there any logical and organized way of handling so many "in/out" options? Or perhaps some other way I can set up the class? I have been trying to think this through without success, and I need someone else's eyes. Perhaps because it is 3:30AM...
Does anybody know how to organize .as files into folders?
Using Flash's publish settings, I can designate the .fla, .SWF, and document class to be in separate directories. That's great, but I'd like further organize my .as files into sub-directories within the folder for source code.
I'm using as container for my LinkButtons. I would like to know 1) How can I remove the space between the items in my Tile container. 2) How can I set dynamic width for my items (at the moment they all have the same width regardless the width of the included component) 3) How can I avoid to display scrollbars if the items are not included in the container
I'm working on a rhythm-based game set to a specific song in ActionScript, in which a trigger spawns on the right side of the screen and moves left. The player must hit the trigger when it touches the left side of the screen, and I'm trying to figure out the most code-efficient way to spawn triggers in sync with the timing of the song. The only thing that came immediately to mind was an update function tied to the main loop that checks if the song is at a certain second each frame, but that seems unnecessary.
I'm preparing to reorganize & refactory a Flash Builder application. The goals of the reorg are 1.) keep compile times for the part of the project I'm working on as fast as possible, 2.) keep the unrelated parts separate for code reuse. Goal #1 trumps goal #2 if there's a trade-off.
Currently, the app has assets in one project, core functionality AS3 in another project, and the MXML in a third project that links to the other two.
Would moving resources/code into swc libraries help compile time? What about compiling assets into an swf and embedding that into the main application?
I'm working with a large Actionscript project, and every file needs to have it's imports organized. I noticed that you can achieve this easily in the Java version of eclipse, but that doesn't seem to work in Flash Builder. Is there a simple way to organise imports for the entire project?
My project is a visual way to represent a database of information about books. It will be represented as a collection of menus and submenus. From one menu, the user will be able to access another, from the other the third.Each item in a menu has some content, so the menus themselves are not a means to an end (to execute commands), but a goal in themselves. Viewing them, and browsing between them is the essence of the project.
The simplest way to organize a menu of items would be a dictionary object containing all its members.However, it is not really good for a complex set of menus and sub-menus which is a web of information linked between another.
I've created some classes for a nav menu and I'm having some trouble dealing with the click. The bottom class of the chain gets the click, but I need to pass that event up a hierarchy of classes to the very top so it can get handled.My hierarchy looks something like this:
Where do I place a function, at the lowest level, so I can call it from any other container above it? For example, I have 3 frames and they all need to use the same function, called "myFunction()". Do I really have to create it in each frame? There has so be a lowe level where this can be placed? Is there a good simple description of AS3 Hierarchy somewhere? Also, how do you specify global variables in AS3?
There are a few mc's already on stage that I've attached dynamically to _root. Now I want to take one of them and attach it into some other mc on stage, also attached dynamically. I want to retain the position, width and height of the former mc. Is this possible? some way to manipulate the pointers or addresses? Can I manipulate the ._parent property?
I'm currently working on a tower defense game and am in kind of an odd situation. I've programmed it in such a way that a large class hierarchy is in place. It's like this StartScreen class ---> BaseLevel class ---> GUI class ---> TowerPlacer class(towers are stored in an array in this class) ----> etc.My problem is that i need to access an array in BaseLevel from my GUI class, is there any fancy trick for doing this? or have i screwed myself over.