ActionScript 3.0 :: Pass An ArrayList Into A Method?
May 6, 2011I am looking to pass and arraylist into a method and I am wondering how this is done...
View 2 RepliesI am looking to pass and arraylist into a method and I am wondering how this is done...
View 2 RepliesThis is what i want to be able to do, only i can't... And i don't want to have a loop when i call the method executing the methods in my children. Hints?
Code:
this.executeMethod([Function(methodInChild)], ArrayOfChildren);
private function executeMethod(_methods:Array, _instances:Array):void{
[Code].....
I am loading a swf from another swf using the folowing method:[code]How do i pass a variable from the first swf into the second??
View 3 RepliesI have 3-4 swf those i want to load one after another like a slideshow.What i want to do is get the total frames of loaded swf and want to pass that value to Timer object's delay parameter. i have converted total frames to milliseconds so i can use it in timer constructor. But i am not getting the value of that variable outside of my Event.COMPLETE listener method. Here is my code what i have done
[Code].....
I upload a file using adobe air HTTPService.Send method by passing byte array of file content read using FileReference. When I write the set of bytes from the server side (php) it writes the details of the byte array (buff) to the file instead of contents of the file like "endian=bigEndian&position=0&bytesAvailable=61127&length=61127&objectEncoding=3" . Below I have included the code that how I read the file and send it to server. Is there anyway that i can directly pass the data in the byte array to send method?
File Read
var buff:ByteArray = new ByteArray();
var localFilePath:String = "/Videos/sample.txt";
var uploadedFile:File = new File(localFilePath);
[Code]....
I would like to create an arraylist and i would like to create a search so if the vaules typed match the vaules in the arraylist .
View 2 RepliesI have this xml file.[code]But I want these node names, example: element,attribute,element in arrayList.[code]
View 1 RepliesHow do I convert in AIR 2 for List component to display items?
View 1 Replies<lfm status="ok">
<artists user="Ewout1" page="1" perPage="50" totalPages="36" total="1766">
<artist>
<name>Have Heart</name>
[Code]....
I have an httpservice that returns this xml-file. What I want to do is put all the names from the artists in one Arraylist.
private var arArtists:ArrayList;
arArtists = event.result.artists.artist.name;
Here's what I have right now, which works:
<s:List id="list"
itemRenderer="spark.skins.spark.DefaultComplexItemRenderer"
horizontalCenter="0"[code]....
but since there is no name property on the BitmapImage object, I get errors.I guess I need to put each BitmapImage in an Object and also put in a string as a property of the object, but I can't figure out how to do this. This is my best guess, but then I don't know how to specify the property name for the BitmapImage:
<fx:Object label="Truck">
<s:BitmapImage source="@Embed('../images/menus/car_types/truck.png')" />
</fx:Object>
After that, I guess I would make a custom ItemRenderer to read out the properties on each object?
It is possible for a class to extend an arrayList of objects in Flex?
[Code]....
I have a datagrid, which gets filled by an ArrayList. I want one column to be filled by another ArrayList. I've tried doing it like this, but that only gets the first three columns filled, not the last one (with the different ArrayList):
<s:DataGrid x="10" y="281" width="597" height="204" dataProvider="{arEvents}" requestedRowCount="4">
<s:columns><s:ArrayList>
<s:GridColumn dataField="title" headerText="Column 1" ></s:GridColumn>
<s:GridColumn dataField="venue.location.geopoint" headerText="Column 2"></s:GridColumn>
<s:GridColumn dataField="startDate" headerText="Column 3"></s:GridColumn>
<s:GridColumn dataField="{arArtistsPerEvent}" headerText="Column 3">
</s:GridColumn></s:ArrayList>
</s:columns></s:DataGrid>
I'd like to create a combobox which will get users from an arrayList & another field for creating a new user. for example when i open the combobox i'd like to see the rows :
Create new user
User A
User B
where the users come form an arrayList and the "create new user" option is always there.
How can I do it?P.S I don't wan't to add "create new user" obj to the arryList - so this is not a desired solution.
I have a custom java class which has an ArrayList and corresponding to it have a custom vo class which has ArrayCollection (in Flex).I want to return data from Java to flex.Every variable in java is getting mapped to vo perfectly except for ArrayList.When trying to retrive When trying to retrive exposureUSDList (which is an arrayList) in flex I am getting empty ArrayCollection. It is not getting mapped properlyPlease find my code below:
Flex Code:
package com.example.vo
{
[code].....
I'm actually working on a multiple collision detection in actionscript 3.0, using pixel collision for a game for my assignment, where an enemy patrols around and searching for the hero. So, i draw a line between the enemy and the hero, to check whether there's some collision happened between those two. if the line colllides with an obstacle such as wall, door, etc. enemy will not be able to see the hero. When i tried a single line collision with a wall (one object only) it works perfectly.
But here's the problem. For the multiple objects collision (several walls and doors included), i added those objects in an arraylist, When i used for loop to check the collision between the line and those objects in the arraylist, none seems to react , except the first object in the arraylist or index 0.
Is there any simpler way to do the multiple collision detection?
I hope this problem would not waste your time. I use Adobe Coldfusion 9 to create CFC to to interact with database. Generally, CFC can be generate WSDL by itself. for example:[URL]..
The WSDL was generated well. But the problem has been found when I tried to use Adobe Flash Builder 4's Data service to generate service class to connect ColdFusion's WSDL.
If you tried to invoked the remote function that return primitive data type as int or String, it works correctly.
[Code]...
Right away i just try to explain my problem: Using BlazeDS i got the following Javaclasses:
[Code]...
Then i got a Flex service class calling BlazeDS and executing the getCategories java method. Since Flash dosn't seem to understand typed arrays, the result from that method which i get back in flex is a simple array of untyped objects (the mapping dosn't seem to work here, even tought the class category exists in flex and has the same properties).
thats the first thing. but however, i'm converting the untyped objects manually into objects of the category.as class. the second thing is that categories have child-categories within the java object, which are also ArrayLists of the type category.java. the problem about that: my result event object only contains the first level of categories, looking into them the children are allways null. i dunno why they are empty, since they ARE part of the java object category.
and the third thing (the strangest by fast), you maybe noticed i named the properties of the category.java class strange, like idCat and nameTest instead of simply id and name. why that? because the property names of my flex result objects dont seem to change when i change the java objects properties names (result object properties are named "id" and "name" but the java class object properties are named "idCAT" and "nameTEST"). that it REALLY strange, since if i set the properties, like you see at nameTEST = "TESTNAME" it IS recogniced by flex, only the proertyNAMES dont seem to be recognized at all.
[Code]...
I'm having to pass data (originally read via an XML file loaded by the parent class) to a child class upon instantiation, and I can't decide which is the better method.I could parse the XML in the parent and throw the data into an Object and pass that object to the child class....or just pass the part it needs as an XMLList and let the child class do the parsing.Seems like a trivial decision, yes, but I'm not sure of longer-term implications.
View 3 RepliesTrying to pass a variable as well and cant seem to escape to pass it. How can I pass using window.open as such: Trying to pass (pid) all i get back is (pid) and not actual pid.How to on a jscommand?
Code:
something.onRelease = function () {
var jscommand:String = "window.open('http://www.someform.php?proj= + (pid)','win','height=200,width=300,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);"); }
I can do a standard getUrl("http://www.someform.php?proj=" + (pid), "_blank"); works fine but no control over window properties.
I am getting this error: 1180: Call to a possibly undefined method startWorld.but the method startWorld is defined as you can see in attachment.
View 4 RepliesI'm tryng to make a public static method call another method, but Flash throws error 1180, sayng that the method called by the static method is undefined.
Code: Select allpackage
{
import flash.display.MovieClip;[code]....
i have a fortran method which creates random numbers. i want to convert this method to a flash method . I want to get numbers from this method and use them in the delay method of flash.
the fortran method is the folowing
real znew1 , zold1 ,a,m,z1,p,TIME1
a= 16807.
m=2147483647
B=2
[Code]....
I have a class called Animal that has a method foo() and I call it out within the Animal class.
Code:
protected function foo():void
{
trace("Animal");
}
I also have a class called Cat that extends Animal and overrides the method foo()
Code:
override protected function foo():void
{
trace("Cat");
}
However when calling the function foo() from the superclass it traces out Animal not Cat (using a Cat object).How can I make superclass call out methods in the subclass?
two classes, both extend EventDispatcher. Static method in 1st class calls instance method in 2nd event not getting caught. [code]also, since dispatchEvent() is an instance method, is there any way of calling it without first instantiating the class? i expect not.
View 2 Replies[Code].....
getUser was already in UserService.java. I just created getUser2 and it's identical to getUser. When I try to call getUser2, i get the "Cannot invoke method" error. question: Do I need to specify getUser2 in some other file? like in some configuration file? if so, which one and how do I do it.
Is there a way to get a method's parameters from outside the method? I know that there's an "arguments" property but it's only accessable from within the method. I'm working on a RPC system and need to store the method parameter types in a hash table for easy access later on.
View 1 RepliesCode:
class A{
function A(){
trace("construct");
}
private function moo(){
[code]....
yet this doesn't, I'd expect it to: construct, start mooing, moo!, moo!, moo!, ...yet the moo! moo! moo! doesn't appear, as if moo() never gets called it all.
OK, from what I know actionscript in Flex runs asynchronously. I need the ability to run a method in a loop synchronously. Consider this code:
public class CustomerContainer extends VBox
{
public function CustomerContainer ()
{
[Code]....
This is not my exact situation as it is a bit more complicated to explain here. There is an abstract class and several custom view objects derived from it. Some of the views are dependent on others being completed first but I cannot seem to order them in the correct order. TIMERS are not an option. Probably not explaining this correctly.
How can I access the "draw" method from the "startDrawing" method below, why is the trace ouput for this code:
Drawing Started
undefined
Drawing Stopped
And once that is solved will the "draw" method be able to call the pen.makeMark method as attempted?
Code:
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;[code].....
I'm using CS5 and I'm trying to pass 2 values from ASP to Flash. I can pass one value, but not 2.
Here's the ASP:
Code:
stranswer = "success=yes"
strresponse = "responsestatus=MESSAGE FROM ASP"
Response.Write (stranswer)
[code]....
The way the function is coded I get a Failed response or nothing happens at all.