ActionScript 3.0 :: Object Class To Store MovieClip And Related Data?
Jun 17, 2010
I'm trying to create a game and have come across something that I have never really played with and am not sure if it is what I need to use in this instance or if it's as powerful of a resource as I am hoping.I have a movieClip that is an animated man. I can move him around my stage by clicking on him and then clicking where I want him to go. But I'm eventually going to need to store information about him. Such as his x and y position on the stage, attributes about him that are custom to my game.Real Quick: The man represents an army and when the user clicks on him, I want to display things like, Military Units in this army, number of men remaining in each unit, experience and so on. If you have ever played any of the "Total War" games you will know what I'm talking about.
View 1 Replies
Similar Posts:
May 30, 2007
I have created a class and I would like each object of this class to be related to a movieclip which I would be able to move around the scene.But I have to admit I don't really know how to do that.
The best would be that each of my objects have a movieclip called "graphical_representation"
[Code]...
View 1 Replies
May 9, 2011
I'm working on a tile based game and I want to create a class file that will hold all of my level design arrays. it seems silly to make this class extend MovieClip so i was wondering what a good class would be to have it extend. I want to call the class file up when loading a level and have it send the array to my tilesetter function in my game engine.
View 2 Replies
Aug 23, 2011
i am preparing a game, the game has four bet spots. i want to save the user bet details. i like to save the user bet details in an object, so i can access it whenever i need. I have done same thing in AS 2.0. my object will look like
player[0].betSpot1.amount="100"
player[0].betSpot2.amount="200"
View 5 Replies
Dec 16, 2009
I have a problem with creating instances from classes created from embedded data taken from an external .swf which has loaded into its library various images exported to ActionScript as BitmapData.What confounds me is that, of 22 images that I'm loading, 14 of them work fine and can be instantiated and displayed to the screen in a test program. The rest of them throw Error #2136, "The SWF file contains invalid data."I'm using Flash CS4 with Flex 3.4.
-----
Attached is a .zip of a few files:
library_tester.fla - contains the code for testing the library
Assets/GridGame/grid_Library.fla - contains the library
[code]....
Right now, the code in library_tester hits the error when it attempts to create Logo after creating two other variables set onto the stage.
View 3 Replies
Aug 18, 2009
I have two classes. One creates a class and the second one plays audio related to the class. When the user clicks the right answer the quiz gets removed from the stage, but my audio keeps playing. I am wondering how I remove/kill the audio class/object at that point.
My class gets created like this:
private var quizAudio:CaseStudyQuizAudio;
and further down:
quizAudio = new CaseStudyQuizAudio(theAudio);
When I tried to kill it, I was think this would do, but to no luck so far:
quizAudio = null;
delete quizAudio;
How is this done?
View 3 Replies
Dec 12, 2011
I'm writing a game that involves cargo, and I plan to have a large number of cargo types. Currently I have a Cargo class, and a ship carrying cargo has an array of the Cargos it is holding. I'd really rather not have each ship with a bunch of objects when all I really want to know is how much of which cargoes each ship has. Especially when these ships will be created and discarded a lot.
I'm sure the thing I'm looking for is so basic I'll look dumb for even asking, but I know there's something similar to an array that holds an object and a related value. I want to use that to reference the Cargo type from the static array, and hold the quantity.
What's it called? How would I use it (ie what are common functions used for it)? Some code snippets and terminology would be ideal.
View 2 Replies
Dec 5, 2007
I don't know if this is even possible, or if I'm going the right way about this.Here's what I've got:
ActionScript Code:
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageProgressHandler);
function imageProgressHandler(event:ProgressEvent):void {
[code]......
View 3 Replies
Oct 24, 2009
i'm trying to get randomly moving objects to scale up as they move further away from their point of origin, I'm haveing trouble with this. I've attached the current random movement code below:[code]
View 0 Replies
May 4, 2007
How to store the data text in Access databases using flash form and to search into the database. It is possible to work without server because I don't want to put this flash file on the net. how to make databases and to connect with flash and to have possibility to search the database, but to work database in the local computer.
View 1 Replies
Mar 15, 2009
When I use MouseEvent.MOUSE_OUT the target is [object MovieClip], but when I use MouseEvent.ROLL_OUT I get [object Bildspel] - and Bildspel is my class. The thing is that when I use ROLL_OUT I'm not able to delete the targets ENTER_FRAME event.
[Code]...
View 2 Replies
Jun 26, 2008
I'm trying to put together an XML based Flash map. On the right side, is a dynamically loaded XML menu. Now, my problem is that the rollover and rollout effects for the menu doesn't work. Basically, I have a movie clip that contains a dynamic textfield and another movieclip (the latter contains a button.I wanted it so that when the user rolls over this button, it plays, and when the user rolls out, it plays an exit "fade")[code]
I've tried using "var menuItem=this._name" to retrieve the "path" of my buttons when you rollOver them (which should be something like "mcContainer.menuItem.bCountyBG.gotoAndPlay(2) ;"), although I need the menuItem to change to whatever this._name is.It doesn't work because menuItem's returned value is considered a string, so I can't use it in my command---> "mcContainer.menuItem.bCountyBG.gotoAndPlay(2) ;I was wondering if anyone can tell me if it's possible to convert this string to a movieclip by some sort of function or other means?
View 2 Replies
Jun 24, 2011
What i want to do and keep failing is this : I have 2 buttons (A and B). After each of them is pressed one certain animation plays. Let's say when A pressed, we see the animation and later I want to see the Movieclip or page related to A. If B pressed, we see the same animation but after that Movieclip or page related to B should pop out.
A pressed = Intro(animation) Plays ==> A Movieclip or Page shows up
B pressed = Intro(animation) Plays ==> B Movieclip or Page shows up
View 1 Replies
Mar 22, 2012
I have some movieclips like this one: game_mc.substage_mc.rightHand and inside the rightHand i have a thread_mc like this:
game_mc.substage_mc.rightHand.thread_mc
Ok so here is the thing, i need to access the thread.x and thread.y position related to the stage or substage_mc i donīt really care, but if i do this[code]...
View 3 Replies
Sep 21, 2009
Ok, I've written a simple class with some string/number variables and set/get functions (tested by creating static objects).
ActionScript Code:
import EventClass;
var aEvent = new EventClass();
[code].....
View 1 Replies
Aug 9, 2011
How To Save A Move Clip As A .jpg Or .gif File Using Actionscript
View 5 Replies
Jan 28, 2011
I'm developing a Flex app which is connected to a webservice - but I'm curious about what is generally best practice for handling the data locally. My webservice provides fairly small XML docs containing all the details about a certain object - is it considered better to parse that XML into objects for use in my UI, or just store the XML and access it directlyMy instincts say the former, though I'm sure doing a lot of parsing / encoding XML objects that I'm wondering if I shouldn't just add and remove elements when needed.
View 2 Replies
Aug 6, 2009
I am trying to create this slide show application that will show product information (Tennis Rackets) based on diffrent categories. A great programmer advised me that OOP would be a way to go, however i am having a difficulty with it.
I created: A document class called CustomClass --> this class downloads all XML data from the server and pushing the content of it into Arrays based on a category.These arrays are public, there is also a funciton iterateArray which places the children information somewhere.
[Code]...
View 7 Replies
Mar 17, 2010
store data to excel
View 7 Replies
Jun 3, 2010
I am working in multi user chat application, in which users chat history need to save. When the user requests his chat history, respective chat history needs to retrieve.Previously, I plan to save them in a shared object. Since shared object has size limitation and also it will be saved in some encrypted form I plan to save them in a database.Now I came to know that data can be saved in a database using web service or xml socket etc...
View 5 Replies
Mar 15, 2011
I am working in multi user chat application, in which users chat history need to save. When the user requests his chat history, respective chat history needs to retrieve.
Previously, I plan to save them in a shared object. Since shared object has size limitation and also it will be saved in some encrypted form I plan to save them in a database.
View 2 Replies
Apr 15, 2012
here's the thing, i need to store different values in a 2d array (or something conceptually similar). The idea is to create a 2d map with tiles and the array would save the ID of every tile in the map. I'm trying to create something mildly efficient, specially because i need to save some memory usage for later use (it has to do with AI) and it must run on a low end PC, but simply creating an array seems to be a waste of space since i only have about 50 different IDs at any given map.i thought about creating a 2d array of 8bit chars would be sufficient, but that's out of the question with actionscript 3, it doesn't have 8bit char data type.
View 1 Replies
Sep 22, 2010
What way of reading and storing data is fastest for AS3. For debugging right now it is just reading the raw XML, but I suspect it would be faster if I made them into nested arrays. Would parsing the XML into nested arrays to be read later be the most efficient method?, or is there a better way to read lots of data?
View 3 Replies
Dec 15, 2010
How to store data locally using Flex 3 in web applications. Without using backend or using shared object.
I came to know that there is something called Data Management in Flex 3. And it is not for AIR application.
View 2 Replies
Feb 17, 2011
I was hoping for some guidelines on the general best practice for storing data from an XML document. When all is said and done, my whole flash site will be powered by XML, so I want to make sure it is organized properly. Usually what I do is parse the XML, and store all the different sets of data in arrays, but I'm sure there's a better way to do it. I'm no expert though, so I need something fairly straightforward. Here's my initial setup:
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("xml/presentation.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
[Code]...
View 1 Replies
Mar 28, 2011
I am a Flex newbie and I'm developing a Flex application that needs to talk to an AMF server in order to authenticate the user.Where should I store the server URL? I don't want to hardcode it in the source code, but the URL should be fixed at compile time, because when I compile the app it should be tied to a specific server.
View 3 Replies
Jul 6, 2009
I'm just looking for a basic tutorial on how to store and retrieve XML data in an external/separate XML file. I've created an XML file before and I for the most part know ActionScript 3.0 but I've never modified and retrieved data from an external XML file before in my flash project.
View 2 Replies
Aug 15, 2009
i have a site and i want to put a login and registration page. I downloaded a template, but i dont want to mess with php for the moment. I wonder, if theres a way to make the login/registration with actionscript to store the data in a xml file when the user registers, and then call it back from the xml to login and then send him to the main site if the data is correct.
View 2 Replies
May 20, 2010
Is it possible to store and retrieve data between separate 'sessions' from an application run from DVD without storing to the local machine?
View 9 Replies
Aug 16, 2010
I want to display 0 to 1200 with y Axis.
ActionScript Code:
private var Yaxis:Number = new Number();
for (var i:Number=0; i<Yaxis; i++);
[Code].....
View 9 Replies