ActionScript 2.0 :: Separate Objects Are Made, Object A And Object B?
Nov 11, 2008
Inside the attached .rar Two seperate objects are made, object A and object B, but they share the same variable (only works with arrays) even though they aren't linked in any way. Any changes made to A is reflected in B, and vise versa.
How would I go about fixing this issue? (SIMPLY, aka I don't want to write a class or whatever, I just want to know if I am doing something wrong, like not writing new or something)
View 2 Replies
Similar Posts:
Oct 29, 2010
I am encountering a problem in my app only when it is run in flash player 10.1.85.3. Some earlier player versions I have tried are working fine.From what I can tell it seems related to the following:
Quote:
from here: h[url].....
When searching for objects (not strings) in Dictionary objects using the 'in' operator, if the object is not found in the Dictionary object, it will be searched for in the delegate objects. With 10.1, the toString operator will be called on the Object if not found in the Dictionary. This can cause problems with Proxy objects who need to define the callProperty function or it will generate a RTE. ...what it means "it will be searched for in the delegate objects"?
View 1 Replies
May 7, 2011
Essentially what the project consists of is I have random balls appearing on the screen and moving around and I need to make it so that the user is able to draw a circle around the ball (may be more than one) and have that balls dissapear and count the number of balls circled.This project is being done in flash builder 4.5 and is being made for the android platform as part of a senior project.I have been able to randomly create the balls and give them a random movement. I have also been able to figure out how to allow the user to draw on the screen.
What I am trying to figure out is how to make it so that if the user draws a circle around the balls make it so that I know these balls have been circled and make them dissapear and have the number of balls inside the area calculated.I have thought about making the entire background a grid and make it so that I can track somehow the line made by the user and then track the coordinate of the balls then if it is within that area it means that the ball has been circled but I would like something more efficient than that.
View 1 Replies
May 7, 2011
Essentially what the project consists of is I have random balls appearing on the screen and moving around and I need to make it so that the user is able to draw a circle around the ball (may be more than one) and have that balls dissapear and count the number of balls circled. This project is being done in flash builder 4.5 and is being made for the android platform as part of a senior project.
At this point this is where I am.. I have been able to randomly create the balls and give them a random movement. I have also been able to figure out how to allow the user to draw on the screen. What I am trying to figure out is how to make it so that if the user draws a circle around the balls make it so that I know these balls have been circled and make them dissapear and have the number of balls inside the area calculated.
I have thought about making the entire background a grid and make it so that I can track somehow the line made by the user and then track the coordinate of the balls then if it is within that area it means that the ball has been circled but I would like something more efficient than that.
View 2 Replies
May 7, 2011
Essentially what the project consists of is I have random balls appearing on the screen and moving around and I need to make it so that the user is able to draw a circle around the ball (may be more than one) and have that balls dissapear and count the number of balls circled.
This project is being done in flash builder 4.5 and is being made for the android platform as part of a senior project.
At this point this is where I am.. I have been able to randomly create the balls and give them a random movement. I have also been able to figure out how to allow the user to draw on the screen.
What I am trying to figure out is how to make it so that if the user draws a circle around the balls make it so that I know these balls have been circled and make them dissapear and have the number of balls inside the area calculated.
I have thought about making the entire background a grid and make it so that I can track somehow the line made by the user and then track the coordinate of the balls then if it is within that area it means that the ball has been circled but I would like something more efficient than that.
I apologize if it is unclear for what I am looking for but a simple description is I am making a simple game where you are able to circle a moving item on screen, then once it is circled the item disappearsand you gain a point.
View 5 Replies
Nov 24, 2011
I have a date object and I want to listen to any changes made to it. The changes can be made by either directly assigning another date object
var newDate:Date = new Date(2009,10,9);
date = newDate;
and by using
date.setTime(timeInMilliSeconds)
I tried using BindingUtils.bindsetter:
var myWatcher:ChangeWatcher = BindingUtils.bindSetter(updateDate,date,"time");
private function updateDate(value:Number):void
{
trace(value);
}
but this doesn't seem to work. I wish to know what am I doing wrong or if there is someother way to do this.
View 2 Replies
Aug 27, 2009
Well this is strange:
ActionScript Code:
var myObject:Object = {firstName:"Alf", age:34, city:"Oslo"};
for (var prop in myObject) {
trace("myObject."+prop+" = "+myObject[prop]);
}
This will output all the properties of the object, but if I make my own class object it doesnt work at all! Simple.as:
[Code]...
View 0 Replies
Sep 12, 2009
I'm using the following code to arrange indexes of objects on the stage the only problem is I can't access an Object that has been made in a class in an external AS document. if i go into the document and trace I can see it but i can't access it from the document class and arrange its index anybody have any ideas?
[Code]...
View 1 Replies
Sep 18, 2010
I'm made an Item class which extends the Sprite class, the Item class basically has a few checkmarks & labels at the moment.
Then what I try to do is run through a for loop of items and create Item classes that I want to place one after each other on the y-axis, so I'm reading the Item.height property to find the y of the next Item in the list.
The problem is for some reason there is always an extra 75 pixels added to the Sprite height at the bottom, no matter how many checkmarks and labels are in each Item class ( varying the height of the Item class ).
Any idea why this is being added and how it can be removed?I'm having trouble figuring this out, I tried dynamicly calculating and setting the Item.height property but when I do that the Sprite is simply cropped.
View 1 Replies
Feb 24, 2012
I want want to intercept the response for an ajax request made inside a flash object via javascript.
View 3 Replies
Aug 17, 2009
I have a class whose primary purpose is to create and manage other classes in my game. One of its variables is an int that keeps track of the players money. It is also creating towers which are objects of their own. However the tower classes that it creates need to have a way of accessing the money integer (so they know if the player has funds for upgrading them)
View 3 Replies
Aug 28, 2009
bit of an odd problem, I have the following piece of code
Code:
var myCookie:SharedObject = SharedObject.getLocal("mySavedData","/")
if(myCookie.data.mySavedText != undefined)
{
var gallerypath:String = myCookie.data.mySavedText;
}
which retrieves a shared data.
If I put this actionscript on the first frame of a new document, it works fine, however I want to use it in something I already have, which uses an external Document class.
[Code]...
View 1 Replies
Oct 7, 2010
I am creating a fish-eat-fish movie and I need some help. I created a fish (pike1) that follows the mouse. Another fish (Chub) is set to disappear when clicked.What I want to do (and need help with) is to have pike1 grow larger (either by just growing larger or having pike1 disappear and be replaced on mouse click by a larger pike (pike2) when the user clicks on Chub
View 1 Replies
Mar 26, 2009
is there a way in action to group to object so when one object is drag across the screen the other object sticks with it, im using flash btw
View 6 Replies
Mar 25, 2010
So I have this Photo class than handles loading a pic, and dispatches an event when the loading is done with:[code]which is simple and works, but now I'd like to make something more advanced. I'd like to dispatch the load ratio.So far I have extended the Event class, with my own EventRatio class, and I can put properties on that class. Which is cool, but I need something more dynamic than just sending a fixed value.So, what is the best way to connect the Loader object of the Photo object, with the EventRatio object?
View 5 Replies
Jun 28, 2011
i have some actionscript that makes a
ExternalInterface.call('someFunction');
call.is it possible to reference the html object that made the call to someFunction directly using the ExternalInterface.call call?
Assume that the object that makes the call also has some Callbacks (via ExternalInterface.addCallback) that are accessible via javascript.
Currently:
Actionscript source
ExternalInterface.call("someFunction");
ExternalInterface.addCallback("someCallback",someASfunction);
[code]....
View 1 Replies
Jun 16, 2011
I have this situation where i'm trying to save "chat logs" while people switch around views in my flex mobile application..so, my plan is i'm starting out with a main object that I plan to re-use as the main chat log object..I call it textObjso, when someone new wants to chat my plan is to make a new object with the persons username.so how if i were to get the username from something like data.username how could I translate that into the var name of the object I want to make? So in the end i end up with.[code]
View 2 Replies
Jan 8, 2011
how i can stop the movement of one object when one other object is over one third object
View 1 Replies
Mar 15, 2008
I have been at this for about 19 hours straight! I am going to go to bed immediately after this post, but for crying out loud, I have NEVER had this problem before today! Before anyone reads ahead and says 'you have to attach your sound object to a completely separate mc to be able to control it independently from all other sound/root volumes.' see if the following code accomplishes just that:
[Code]...
View 2 Replies
Jul 31, 2011
I'm learning to use Object-pooling. I'm trying to see how to get objects from the start of the pool and shift all the objects at position i to i-1. I've had a look at Adobe's help file on the subject [URL] but there I'm confused.
[Code]...
View 2 Replies
Feb 10, 2009
I have been trying to find out what other objects are within an object (AS3 )and am unable to get it going.With AS2, I was abl to simply run "for in" loop to get all the information.
View 2 Replies
Feb 1, 2010
I want create game. In game will player. And this player must go on blue boxes(so, player can go to left, right and jump). How i can do it?:)Also attached picture and files.
code:
package code{
import flash.events.Event;
[code].....
View 1 Replies
Aug 12, 2011
Can I put one object under two objects?
View 3 Replies
Oct 19, 2010
I'm making a scrolling list of objects, and I want each to have an over state. Normally I'd make a separate frame for each over state, highlighting the respective object.This list, however, has over 50 objects. That means I'd need over 100 different frames to shuffle through on this one movie clip. Is there a better way? I tried using a plain white movieclip at 50% alpha and attempted addChild-ing it on top of the target but that didn't work out
View 2 Replies
Apr 7, 2012
I would like to add a bunch of cars to the stage, and store them in an array as objects. The problem is I hate using external AS files and would like to keep it as simple as possible.I tried doing :
var car:Object = {carcolor:String,carscale:Number,carpower:Number};
var test:Array = new Array()
for (var i:Number=0; i<10; i++) {
test.push(car)
}
The problem is if I try to set a value of one object in the like test[1].carscale = 5
Every object in the array gets their attribute carscale set to 5.Is there any way I can do this without using external class files?
View 4 Replies
Mar 7, 2009
i have objects on my stage and when i rollover on each object he raize.exmeple u can see here (here i make only 2 objects):http: [url]....what i want to do is that all of the objects have the same depth but when one of my object rollovered and he start to raize get the top depth (up then other)
Code:
stop();
acceleration = 10[code].....
View 3 Replies
Oct 23, 2008
Using AS3, I was wondering how to control one object, a ball, while another ball bounces around. I'm modifying code from "Foundation ActionScript 3.0 Animation" by Keith Peters.
I'm pretty new so I'm probably making some obvious mistakes here. First of all I thought I could refer to the balls as ball[0] and ball[1] since they are in an array called ball. Is this correct?
[Code]...
View 7 Replies
Jun 2, 2011
let's say you're passing an object to a function {title:"my title", data:"corresponding data"} how can I get the function to know what the names of the items/sub-objects are (title and data) without specifying them?
View 2 Replies
Mar 17, 2012
Right, so here's the scenario: I have 4 objects, A, B, C and D. What I want is that C obscures A, but not B. Similarly, I want D to obscure B, but not A. A and B can overlap each other in any order, it doesn't matter.In other words, what I want is an object (C) to be able to cover one object (A) but not another (B), even if it comes into contact with it.Same with D, which can cover B but not A, even if it comes into contact with it. The problem is that I can't think of a layer configuration that allows this: D will always be higher than both A and B, and thus will obscure both.I'm not expecting anyone to come up with some unfathomably clever configuration, but I'm wondering if there's some kind of ActionScript that can do this. In particular, I would like A and B to be dynamic TextFields, and C and D to be MovieClips of any shape (i.e. not a rectangle).
View 3 Replies
Aug 21, 2011
I'm creating an application where the user can select an object from a list of objects, and then put it on the main window.
I want to have the list of objects presented like in the web app : [URL]
The user can select a category, then the list of objects of that category is displayed, then he can drag and drop an object to the main window.
How is it possible to do this, having a list of objects?
View 0 Replies