ActionScript 3.0 :: Storing Data Use An Array Or A String
Jun 12, 2009I have a input text field on the first frame. I want to use the data from that text field in the next frame how do i do that using an array or a string.
View 1 RepliesI have a input text field on the first frame. I want to use the data from that text field in the next frame how do i do that using an array or a string.
View 1 RepliesI have some binary data and I can't store it in a string, as such I'm using a ByteArray. The problem is that I need some functionality that comes with strings, to be specific I need the charAt, substr, indexOf and substring methods.
View 1 RepliesHere's my scenario: in my product info MC, user can select from 4 categories which gotoAndStop a nested MC. Each of the 4 categories has 5 hit areas on an "imagemap". The problem that I'm running into is that on each of those hit areas (mc's), I have actionscript - so that's 5 x 4 of essentially the same actionscript. Only difference is text information and _x & _y co-ord's (code is for caption/images boxes) Could I store all that data in an array in the product info MC rather than having 20 blocks of actionscript?
View 5 Repliesi am looking for some kind of library which does CRUD easily using PHP and MYSQL.My goal is to make some app in flash AS3.0 , where i will be receiving some data from user and storing in data base , and perform CRUD opertaions. I dont want to be so much involved in writing php and sl query.My scenario is:
Data types : [ like user_profile data, etc]
add under data types 1 to many fields with various types..
Database tables and realtions etc should be done by my DREAM library, then user when select a Dtat Type, he is presented with related fields to fill up data.
I will be using Flash AS3.0 ( Builder or IDE ) to perform .If only i can find some php library i think AMFPHP can connect flash with php
I know
insideInput = String(xmlNode.childNodes[0].attributes.insider)
virusTarget = insideInput.indexOf("kz", [17]);
endTarget = insideInput.indexOf(".", [virusTarget+2]);
trace("VTTT"+virusTarget)
trace("ET"+ endTarget)
//endTarget = local.indexOf(".", ["vitesting"]);
clipTarget = virusTarget+3;
zebra = insideInput.substring(clipTarget, endTarget);
trace(zebra)
I'm trying extract info from a string, increment through it and add the data to an array. I can't get the startIndex thing to work.
I'm parsing out a greensock easing function as a string from an XML (as in "Strong.easeOut"), but then I need to store that in a variable as a Function type to call later. how is this done?
everything else i've found has been how to call a function from a string, as in this["functionName"](). i don't even know if using "this" is the correct scope for a static function in another class?
For my calculator i am having trouble storing a number inside a string variable.
[Code]...
Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.
For my calculator i am having trouble storing a number inside a string variable.
Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.
Code:
var currentNumber:String ="";
function pressNumber(e:MouseEvent):void{
display_txt.appendText(e.target.num);
currentNumber.append(e.target.num);//error here
}
What is the best way to store data gathered from a flash file, and load it into another flash file? Would xml or php work? and could it be instantaneous? Here is a diagram of what i am trying to do...
[URL]
I need some help with my code please. I have a for loop that creates sprites and loads images into the sprites theough XML. I have additional nodes for each image and sprite that get created that I want to store and call when I roll over the thumbs. What would be the best way to do this? I had to "improvise" and have the for loop create text fields to hold the data and then call it when I roll over throught "evt.target.
[Code]...
When a key is pressed, data is sent to PHP to be stored in a MySQL database. For each key press, only one entry should be posted. it re-posts exponentially (e.g., 1st key press = one post, 2nd key press = two posts, 3rd key press = three posts; thus, totaling six posts).Initially, the event listener for key press existed alone on a single frame. When that was the case. This issue did not occur. I added an additional frame so that I could set to clear out all variables and start fresh.
so frame 4 will have :
KeyListener = new Object();
KeyListener.onKeyDown = function(){
if (Key.isDown(69)){ // if key pressed is "E"
[code]....
There is a combo-box by the name "cbJobs" and it gets its value from the XML file named "data.xml".. I want to store the value transferred from this XML file into a variable.. so basically someone told me to use the code
on (change) {
_root.subject = this.getValue();
}
the only problem with this code is that it gets activated only after I "change" the value in combobox by pulling it down.. I want to use this value obtained from _root.subject as a subject in the script
getURL("mailto:abc@abc.com?subject="+_root.subject);
I'm now writting a little drawing tool, that will allow users to save their drawings and the redraw them. Now I'm only concerning myself with diferent colored lines with diferent thickness. So now I only need to store the values, that will be used later on when calling the canvas object's graphics.lineTo(....); method. I'm planning to save all of my drawings in XML, but I still need to load them up when I want to use them.
Given my situation, what's the best way to load up my data (after loading it in chunks): Arrays, Dictionaries, anonymous objects. We're talking about loading up, let's say ~ 1000 Point instances for a very simple shape, since I want the drawing to be pixel-perfect, since I will be modifying it to a more sophisticated tool later.
I'm currently having abit of problem with splitting some data and inserting it correctly.On screen I am going to have 3 movieclips (with a dynTextfield already placed inside them).Using data imported from PHP I plan to put the project names of the returned results inside the movieclips. The problem with this is if the results are more than 3 then there aren't enough movieclips. To over come that I was thinking of using a 'more' button where the project names would get pushed out of the movieclips and the new set loaded in/along.
At the present moment I can split the data (received from PHP) and trace it accurately, although I'm not sure how to go about storing it now. I was going to use and Array and store to store the info and call it in the buttons, however I haven't used arrays before.
Code
Code:
function fetchInfo(){
//Query DB for existing projects:
fetchProjects = new LoadVars();
fetchProjects.userID = _global.UserID;
[code]....
At the moment in my test there are 2 results that are returned.
I was wondering what the easiest way to store a small amount of data on the server would be.
Basically I wanna keep a hiscore table for a flash game, and would need to store juz a couple of names and a couple of score in a little file, but i havent the faintest idea how to go about it.
I am doing an AS3 application. In the beginning of my AS file, I need to embed different textures as the following:
Code:
[Embed (source = "./myImage1")]
public var Image1:Class;
I have to embeed n bitmaps. Then I have to create an instance of each oh thease classes.
I want to store the names of thease classes in an array so I will be able to create an instance of a class by accessing the array.
Something like this:
Code:
var arrayOfClasses : Array = new Array();
arrayOfClasses.push(Image1);
arrayOfClasses.push(Image2);
...
Then I want to go through the array and do :
Code:
var variable : Object = new arrayOfClasses[0];
But this dosen't work! How Can I build an array of classes? Is it doable?
I have 15 sets of x and y values, that should be stored together. I was thinking I could have an array, holding 15 other arrays, each holding the x and y value? Is that a valid way to do this? Also, is there a way to create those arrays holding the x and y, dynamically, so they just get numbered?
MainArray[
subArray[x1, y1];
subArray[x2, y2];
[Code]...
Obviously, above is not correct AS. Is this even a way to do this? Are there other much better ways?
I have randomly generated 6 numbers, I need to know how I can store these in an array, and from this array the numbers will be compared with 6 number of another array to see how many balls are matching!
View 2 RepliesI have a few items on the stage with different types of item.
cube_0 ++
square_0 ++
triangle_0 ++
and so forth
I have this scroll bar to rotate each item. When a user click outside of it, it will close down(removeMovieClip) I want to store the last x and y coordinates of [let's say] cube_0 's scroll bar.. so that when a user re-opens the scrollbar, it will be at the last coordinate when they close it.
i am trying to create a menu which is 100% on the fly. the menu item names are stored in a multidimensional array with attatched sub menu items/names. i am trying to create a mc and a txt field for each item in the top menu. i am trying to also store the newly created mc's and txt fields in an array or their own so i can manage the menu motions/tweens better.however, i get several errors, why wont this work?
// ed@goelegant.com
// http://www.goelegant.com
// menu.fla
[code].....
i'm trying to make it easy for artists and level designers to implement game entities without writing a drop of code.
for instance, 5 different monsters are similar but with different attack speeds. i'd like to embed stats (for instance attack speed, health, etc.) in each of their movieclips.
the only way i can think is to embed textfields with instance names of "attack speed" and "health", and then delete the textfields at runtime. is there a more legitimate way of doing this?
I have a simple Flash slideshow that reads XML
The XML files contains a few settings and several data entries
I want to make it read from a database instead
I can't make my mind up how I should use the database and how many tables I need
IMPORTANT: I will have several instances of the same slideshow on several different places - how to best store the data
I'm goofing around with developing a Flash game that would be accessible via a Facebook application but am still trying to figure out how I want to organize the game itself. The game essentially is an educational game with competitive components - completing tests faster results in more points with which you can customize your avatar and other items in the game. Also, passing certain "lessons" open up new lessons. So the major components I see are:- Player data storage (scores, progress, etc.)- Social connections - transference of rewards, comparing high scores, etc.- Lesson data (what questions to ask, possible answers, etc.)How is this best controlled? PHP and SQL? XML? Should I use datagrids as an intermediary? I'm having a lot of problems finding good information, both on the internet and at the bookstore about how to manage this.
View 3 Repliesi'm trying to find a solution to this problem: in the frist frame of the project i have 3 radiobuttons (Mambasradio, Amaronradio, Mastajbuonradio). In the second frame i have a ComboBox (Centers). I created 4 Arrays (mambascenters, amaroncenters, mastajcenters, nothing) and i tried to change the Array of the Centers.dataProvider with the RadioButtons selections. So if i selected Mambasradio, the dataProvider will beCenters.dataProvider = new DataProvider(mambascenters)I tried a lot of things but i didn't figured out of this. It gives me a Null Object Reference error in second frame. Here's my code.
Frame1
import flash.text.TextField;
import fl.events.DataChangeEvent;
[code].....
how "you" would do it and then deciding my strategy from there.What I'm setting out to do is as follows:I have a UI with about 10 sliders and 10 buttons.I'm using Senoculars Virtual Mouse class to record all of the users interactions into arrays (basically [x,y, action, time, value]) and then after a decided time (say 3 minutes) I play the users interaction back to them.All of that works fine but now the data is not persistent.I would like to be able to store the interaction data somewhere and then a user can log out, log in and view their previously saved interaction.how would you go about saving this data? I was thinking about storing it in a XML file but I'm concerned that the file would wind up being ridiculously huge. If a user drags a slider from left to right just once thats saving [x ,y action, time,value] 42 times.
View 3 Repliesokay, so i have a basic drawing app based on
drawing = false;
data = '';
_global.linethickness = "2";
[code].....
I am making app that works as stand alone, do some calculations and sting formating. Also it need to save data localy, and be able to reload it when needed. I have read that Shared Objects do that but also have limitation. For example the data can be deleted without user doing it. I need the data to somehow persistend and been able to delete only by the user of the app. As extra exporting data for other user will be usefull, but is not requared.
View 1 RepliesI am making app that works as stand alone, do some calculations and sting formating. Also it need to save data localy, and be able to reload it when needed.I have read that Shared Objects do that but also have limitation. For example the data can be deleted without user doing it. I need the data to somehow persistend and been able to delete only by the user of the app. As extra exporting data for other user will be usefull, but is not requared
View 2 Repliesi want to make the elements for an array, each one i++........so
ArrayOne = Array()
ArrayOne[i] = i
i++
make it work so the array would liik like....
ArrayOne = [0,1,2,3,4,5,6,7...]
i want to make the elements for an array, each one i++.[code]can somone make it work so the array would liik like.ArrayOne = [0,1,2,3,4,5,6,7...]
View 1 Replies