ActionScript 3.0 :: Create Array From Multilevel XML File?
Jan 3, 2011I am working on making an app to display xml data, which currently is using data from parameter file where the data has been stored in array format.[code]...
View 11 RepliesI am working on making an app to display xml data, which currently is using data from parameter file where the data has been stored in array format.[code]...
View 11 RepliesI have an appliacation which displays the data from a txt file which contains data and which is being reffered to as an array. Here is the parameter data:
cont = [
[ {txt:"The Fragrance" },[
{txt:"Top Note", frame:"topNote" } ,
{txt:"Heart Note", frame:"heartNote" },
{txt:"Base Note", frame:"baseNote" } ]],
[{txt:"The Packaging", frame:"packaging" }]]
I'm trying to create a multilevel staged game where one class, the main class decides which stage to go to next. Using getters and setters, I'm new to this method of programing and the book we have been using this semester in class has been great up until the chapter that tackles object-oriented programming.
[Code]...
Sorry if it looks sloppy, I did not see a way to format the code for proper display on these forums.
I am trying to create an array of purchases or objects. I have several products that I want to store the users selection to contain the item they selected, price, & quantity. I'm at a loss on how to set this up. Currently the user can select their product and their total price will be displayed in the Cart Total text field but I have no way of storing the data.[code]...
View 0 RepliesThis is a hard question to phrase and having trouble finding the right search terms. In the last couple of weeks I have been learning AS 3.0 and the fantastic Classes that are cool as heck (not a programmer... well sort of). Everything has been working great and I've grasped the concepts well, but because of my lack of experience I am not sure of the "best" way to do some things. For example where (which "as file" to create an array of characters?)
This is a very simple game:
25 "characters" (character class in Character.as)
All characters have the exact same properties with different values:
charName:int
life:int
strength:int
movement:int
type:String
char_mc:MovieClip (or sprite.. probably mc)
There are 2 types of characters; shipCrew and aliens. The differences between the two is that shipCrew can use various weapons and have unique "names". Aliens don't have names, just a type and they can grow and/or multiply. All of the interaction and basic game play I can handle no problem once I figure out "where" to create my characters and classes and or subclasses. My initial "training experiments" worked well... until I started reading up on "best practices" in coding and realized I had it kind of all mixed up and backwards. My concern is "doing it wrong at the start".
My first stab at this was to create the array of ALL characters in the "main.as" class for the document, then looping the array, creating new character instances on the stage. Since each character has different properties I just created the same array properties for each with a different value. So basically I am "hard coding" all the characters up front "by hand" so to speak with all the properties in the array. Since they were all identical basically, looping the array to "do stuff" was straight forward... for now. The array looks horrible in the code and is hard to "read" but since it's all "static" anyway it doesn't seem to matter... but would still like to "do it right".
Game play is simple because at a basic level each character regardless of what type it is will do the same thing. I would expand on the differences later. However as part of this inquiry I will need class instances on the stage to communicate with each other (like the idea of a registry for this). So my questions are:
Should I create individual as class files for all 25 characters? (icky?)
Or use an array to store the character class objects? A dictionary? A vector?
They all worked, I tried them all. I like arrays better because easier to deal with, but dictionaries look like fun and might be more efficient (only 25 items, how bad could it be?) storing in an object works too. Whatever type of "array thingy" I choose, Which class file do I create the array in? In the "main" document class or the character class itself? In another type of file like an "init" file? Could I create a "custom" file "type" or class... thingy like "CharacterCreator.as"? How about using a registry?
I'm trying to implement a dynamic flash site and would like to have multilevel deeplinking. how to use swfaddress with more than 3 levels of deeplink but found nothing.
View 9 RepliesActionscript Code:
<root><node><child><grandChild></grandChild></child></node></root>
Actionscript Code:
Arr[0]=rootArr[0][0]=nodeArr[0][0][0]=childArr[0][0][0][0]=grandChild
Help needed to create Multidimensional Array from Recursive XML.
All I need create Array inside an Array dynamically from an unknown XML tree.
Is it possible to, if you have an array of class names like ActionScript Code: var city01names:Array = ["pic_01", "pic_02", "pic_03" ...] make a new array which would read these names, instantiate them, and push them into a new array containing the instances of all these pictures, which I could then use for a slideshow?
[Code]...
convert pdf file into byte array.and also i tried in Google also but no results yet.can u prefer how to convert pdf file into byte array and retrieve byte array into pdf file in flex application.
View 1 RepliesI have 2 arrays:
Array 1 = [1,3,5,7,9,10];
Array 2 = [5,7,10];
Now, I wanted to create a new Array the is the same as the length of Array 1. The output should look like this:
New Array = [0,0,5,7,0,10];
I have an array collection of strings and integers (which I have displayed in a data grid) and I am wondering if it is possible to export the array collection into an html table? or even a text file for the user to download
I found some pages that had an export to .xls files but I want to stray away from that for now.
I have a file I am saving out in php that is just a txt file that has an array in it like this:
array (
0 =>
array (
'key' => 0,
[Code].....
Then I am trying to bring it back into flash as an array. I have tried things like "as array" but that doesn't work. converting this "string" from a txt file into an array in flash?
Having got into flash about a year ago, I have a fairly good understanding of as3, but I have never had any reason to learn as2. For an upcoming project, we were looking to use Scaleform GFx, with the UDK. (Unreal Development Kit) Trouble is, Scaleform only supports as2. From what I've been told, as3 is supposed to be better in just about every way, so I really don't want to learn a language that?s most likely on the way out, if I have any other options.
Is there any converters out there, that can convert script from as3 to as2? Or another workaround possibility, since flash communicates with the UDK by means of just calling a function, could I create an as2 file that could dynamically load an as3 file?
I asked this earlier but maybe I didn't give enough information. I am working on a website where video quality is very important and the client is delivering me the video already compressed. I then want to import it to flash CS3 and export it as .flv for progressive download with the media playback component. I have done all of this successfully in a sense that it all works but the video quality is not good enough, it's good but the client says it;s a bit grainy. I used the highest setting in Flash, on2 vp6 at 700kbs.
My question is what is the best file format (.mov etc) and what settings should the client use, so I can create the highest quality .flv export from their .mov file? Second question, I used an 8 second buffer but now the client is saying they don't want it to buffer at all. What are the other options besides progressive download, I have never delved into this before?
For some reason I am unable to create a FLV file from a MP4 file with high bitrate. I even created a custom setting and specified bitrate as 2500 but the output file is always around 775.
View 9 RepliesI'm in flash cs3 project. I need to create a pdf file from an image path included into an xml file or if easy also in a written path as the code below:[code]
View 0 RepliesIs it possible to just create a .AS file and define constants inside of that file? Without making a new class, just so that all my classes can access these constants? This is of course possible in PHP, but are the scopes handled differently in AS3?
View 3 RepliesIs there a any way to create a txt file in as3 and save reports in that file?
View 1 Repliesi need to split a large text file into an array at line breaks so one array element = one line.i have tried the using "" in both match() and in RegExp but it doesnt work.i had the g and m flags on. tried the $ sign too.
View 8 RepliesIs there a any way to create a txt file in as3 and save reports in that file?
View 2 RepliesI am trying to create a swf file from my original file. I have published swf files before from this file but all of a sudden I get a error. It says "Be sure the destination file is not locked or on a locked drive. Also, check that the file name is not too long. I checked the files and neither the destination file nor the drive locked. The file is named index and always has been named that. What am I doing wrong?
View 6 RepliesHow do you create a .flv file from a flash file? (Flash CS4)
View 2 RepliesI have a glossary that I am trying to build. Each letter is in an XML, I want to create an Array to store letter "A", then dynamically create a "B" array and so on. this is what I have so far:
PHP Code:
var iTempNum = 0;
var iTermTotal;
[code].....
Suppose you have a round based RPG type game. The player issues directives to his units, your enemy AI issues directives to its units. The problem is that the functions for those directives then have to be executed in a specific order with no relation to the order they were input in and all at the same time with the push of one button.
I just need a little direction here, I just spent the last fifteen minutes searching "AS3 Array of Functions" before figuring out that maybe that's not the way you do it in AS3.
Essentially, I'm looking for the way to store functions, put them in a list to be sorted in a specific order and then execute them in said order.
Suppose you have a round based RPG type game. The player issues directives to his units, your enemy AI issues directives to its units. The problem is that the functions for those directives then have to be executed in a specific order with no relation to the order they were input in and all at the same time with the push of one button.
I just spent the last fifteen minutes searching "AS3 Array of Functions" before figuring out that maybe that's not the way you do it in AS3.Essentially, I'm looking for the way to store functions, put them in a list to be sorted in a specific order and then execute them in said order.
I created a multidimensional array and I am having a hard time using .push to start another line. I have tried many thing however this is where I am at right now:
Actionscript Code:
arrayName = new Array(new Array());arrayName[0].push("cats");arrayName[0].push("dogs");arrayName[1].push("panthers");trace("arrayName[0][0] = "+arrayName[0][0]);trace("arrayName[0][1] = "+arrayName[0][1]);trace("arrayName[1][0] = "+arrayName[1][0]);
As you can see the last trace (arrayName[1][0]) comes back undefined. How do I add the [1][0] level of the array?
how to create unsigned arrays with keys in actionscript 3?
in php its simple:
array('key' => 'val');
in ac3 you can create unsigned arrays like that:
['val']
['key': 'val'] // breaks
I have a Class as follow:
class com.flightstatus.SpecificationFlight
{
public var Airline:Airline;
public var FlightNumber:String;
[code]...
Now I want to create a array of above type like below:
var myArr:SpecificationFlight = new Array();
This type is very crucial as it will be sent over webservice.
I'm trying to figure out how to draw a polygon from an array. I've found a few examples, one which the author says works, but am not getting anything to appear. I've traced the array (it's registering) and am getting no errors.
Code:
//called from constructor
polygon(thisArray);
[code].....
how to create an array of ListItems... like {label:X, value:0}? What type of object is that as well?
View 0 Replies