ActionScript 3 :: Difference Between Wildcard And Object Datatypes?
Sep 20, 2010
When declaring a variable to have an open datatype, is there any difference, especially a performance difference, between typing a variable as a "wildcard" (I'm not sure of the official name for this) and typing a variable as an Object?
var myVar:*;
var myVar:Object;
View 2 Replies
Similar Posts:
Sep 3, 2011
I want to know the difference between [object main timeline], [object Stage] and root in as3? I have read from the topic How stage, root, and MainTimeline Fit Together. But I didn't get clearly.
View 3 Replies
Apr 27, 2010
I think i am lost with basics itself. What is the difference between these two. String object is an instance of String Class.
[Code]...
View 3 Replies
Dec 11, 2009
1) Is it true that every data type within as3 is a subtype of Object?
2) Is there any (ANY) difference between typing a variable or function argument or function return as Object versus *?
View 4 Replies
Jun 7, 2010
I'm making an Air app that involves users being able to load in a bunch of pics (of their choice), label them and move them around to place them in some sort of order. No problems there.
Crucially, I need them to be able to save the results for later use as it's an educational resource for teachers who might wish to prepare the resource at home or in their office for use in the classroom. Consequently, portability is crucial and I would like to simplify the process as much as possible.
As it stands, I could easily save all the necessary data as jpg's (maybe even one big jpg for the images) and the data as xml. However, having to move various files is guaranteed to confuse a lot of my users and so I'd like to create one file, with a bespoke file extension that they can move easily and then just double click to open the app, much as you would a Word document, for example.
Which leads me to the 'how'. I bit of research seems to indicate (although I may be wide of the mark here) that the ByteArray class may be of use here. Does this seem reasonable? All I want is to store everything in one file, basically.
View 2 Replies
Jan 24, 2011
I'm working on a function that takes the stage mouse coordinates in Flash AS3 and returns tile in a hex-grid below the cursor. I want the function to return NaN or undefined if the cursor is not on a tile and if it is, the integer index of that tile in an object array.
public function getCursorTile(mX:Number,mY:Number):uint
{
var tileIndex:uint = new uint(NaN);
[Code].....
I've been using uint for most integer variables, perhaps this data type doesn't support NaN or undefined? This code traces 0 after tileIndex is defined. I'm using hitTest because the hexgrid isn't square and is randomly generated. Tile 0 is the first tile and returning 0 when the cursor is off the hex-map is going to cause problems.
View 2 Replies
Apr 21, 2011
WSDL defines a number of datatypes supported by web service . Is there a documentation stating the various equivalents of those datatypes on flex side. In general for any language that we use to consume web service, how do we get to know the equivalent datatypes of the wsdl types.
One of the web service that I am consuming is returning base64Binary (an image binary data) , What is the equivalent datatype of this on flex ?
View 2 Replies
Aug 2, 2010
Is there any difference between those three declarations?
var x;
var y:Object;
var z:*;
Is there anything in AS that's not an Object?
View 4 Replies
Jan 22, 2011
What exactly is the difference between an object and a dictionary in Actionscript?
var obj:Object = new Object();
obj.something = "something";
var dict:Dictionary = new Dictionary();
dict.something = "something";
trace(obj.something, dict.something);
The trace statement seems identical...
View 3 Replies
Nov 4, 2010
What is exactly difference between casting with np: DisplayObject(myObj) or
myObj as DisplayObject
View 9 Replies
Dec 3, 2005
What the difference between an object and an array is?
View 14 Replies
Jan 29, 2011
I'm trying to solve an Actionscript problem using E4X.I have an XML like this one:
<root>
<person firstname="john" lastname="doe" age="21" />
<person firstname="jayne" lastname="doe" age="35" />[code]....
I want to have just one function search() that takes three parameters (firstname, lastname, age) and return an XMLList. So the result could look like this:
var result:XMLList = xml..person.(@firstname == firstName && @lastname == lastName && @age == age );
But I don't want to use all three parameters all the time. I would like to have a function that uses a 'wilcard' if the parameter is NULL. So if the wildcard would be "*" the function could look like:
searchPerson( firstName:String ="*", lastName:String = "*" , age:String = "*") {...}
so that I would only pass 'John' for the firstName I'd get the first and the third node in return.
View 2 Replies
Jan 9, 2010
I don't understand what is structurally different between a Value Object and a Class in ActionScript3. Can any Class be a VO if you decide to call it one?
View 1 Replies
Feb 1, 2012
What is the difference between the code (i) and (ii) written below ?
[CODE]...
View 1 Replies
Sep 27, 2010
I can use the following code to load in a specific swf:
var clips:Array = ["001/001.swf"];
but how do I tell Flash to load whatever file is in the 001 folder without stipulating a specific filename?
View 1 Replies
May 27, 2011
I would like to use a switch statement i.e.
[Code].....
What I am trying to do is to say that the condition is if the name property has an A character in it and anything afterwards. Is this possible or am I nuts.
View 6 Replies
Feb 7, 2010
What is the differences in use of these two objects? Which one should be used for a "Youtube-like" video player with a custom skin and playlist?
View 2 Replies
Oct 26, 2011
I have 2 possiblities. It looks like these are the same (or I'm wrong). Which is better and why?
var quest1:DisplayObject = FrameCanvas.baseCanvas.addChild(app.questionmark1); //
quest1.x = posX; //
quest1.y = posY; //
or
app.questionmark1.x = posX;
app.questionmark1.y = posY;
View 1 Replies
Mar 17, 2012
Premesis:I am using actionscript with two arraycollection containing object with value to be matched...Let's assume I have two list of elements A and B (no duplicate values) and I need to compare them and remove all the elements present in both, so at the end I should have
in A all the elements that are in A but not in B
in B all the elements that are in B but not in A
now I do something like that:
for (var i:int = 0 ; i < a.length ;)
{
var isFound:Boolean = false;[code].....
I cycle both the array and if I found a match I remove the items from both of the array (and don't increase the loop value so the for cycle progress in a correct way).I was wondering if (and i'm sure there is) there is a better (and less CPU consuming) way to do it...
View 1 Replies
Dec 30, 2009
I just had a weird issue occur. I had the following include statement:
Code:
import fl.transitions.*;
and when I tried to add a this Tween:
[code]....
View 3 Replies
May 25, 2010
How to connect to MYSQL DB from Java, create table, insert data, retrieve it with datatypes. How to make use of the data to/from in Flex application. i have basic knowledge in sending and receiving messages using BlazeDS.
View 1 Replies
Sep 3, 2011
I want to know the difference between [object main timeline], stage and root in as3.
View 1 Replies
Jan 1, 2011
I have one file in a folder. I want to access that file but all I know is the extension. How would I link that file? At the moment, I have:
new URLRequest("music/*.mp3")
I have also tried various others such as:
new URLRequest("music/'*'.mp3")
new URLRequest("music/*.*")
When I put the actual link in such as:
new URLRequest("music/song.mp3")
It works perfectly fine, though.
View 2 Replies
Dec 3, 2009
Here is my crossdomain.xml:
HTML Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
[code]....
View 1 Replies
Feb 9, 2012
I just wondered, what is the benefit of listing each class in imports separately instead of using a wildcard?[code]Is there any benefit at all?
View 3 Replies
Jul 29, 2010
Here is how I usually write the compile task:
[Code]...
What I'm looking for is a way to compile the entire director of classes without having to specify each class. I'm sure there's already an option for that, but I couldn't figure out the exact syntax.
View 1 Replies
Oct 14, 2009
I have a task: I need to place about 100 sprites on one canvas (with prepared grid on it). I need to place them as invisible (circles) stones, on the board, and make visible only on mouseover. The problem I come across is following, I can't place those objects accurately into the nodes on the grid.
[Code]...
View 2 Replies
Oct 4, 2004
im going through ASDG, page by page, and learning everything from scratch. he's explaining datatypes, i.e. strings, numbers, booleans, arrays, etc...i get that. then he goes into explaining how to convert datatypes from numbers to strings using "toString" , and then strings to numbers using "Number()"...and then later, strings to booleans and stuff. My question is this. where someone would want to turn a number into a string or a string into a number? and how would someone even turn a string into a number? i dont understand how that works.
View 5 Replies
Dec 20, 2010
what are the differences between '.this' and '.stage'?
View 4 Replies
May 24, 2011
What are the main differences between the versions?
View 3 Replies