ActionScript 2.0 :: Flash Return Gathered Data To Flash
Jan 7, 2009
I was attempting to improve my very limited PHP skills by using a fancy parsing script I threw together from multiple examples I found. But that didn't work out for me, and since I have a client waiting, I decided to use Flash for the hard stuff instead.My problem is that I can't find out how to return the gathered data to flash.I've successfully printed the data using the following:[code]. I need to be able to tell the PHP file what directory to use, from Flash.[code]
View 1 Replies
Similar Posts:
Mar 26, 2010
need to create some simple code that uses data gathered from a form (which ive already coded and vaidated) to generate some sort of visual representation based on the input data.
View 1 Replies
Jan 10, 2012
I've got a Gridcolumn in a Datagrid (Spark). The Column's dataprovider is a Number value that gets updated via Binding.Now, without an item renderer the cell displays the correct values.If I set an item renderer, I can't access the values in this renderer.My renderer looks like this, so nothing really do here (for now) but to trace the value, but the value is always NaN.
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%" >[code].......
without the renderer, the column displays the correct values, so apparently the DefaultGridItemRenderer works fine.As requested, here is my Datagrid;
<s:DataGrid id="dataGrid" dataProvider="{_listItems}">
<s:columns>
<s:ArrayList>[code]..........
_listItems is an ArrayList with instances of a model class, which has (amongst others) a property called change of type Number.
View 1 Replies
Oct 15, 2009
I have an xml file (externally saved) that is similar to the following:
[root]
[main]
[title]...[/title]
[Code]....
What I like to do is to get what's in [title] tag using HTTPservice, import it into Flex, and save it as array objects, and do the same thing for [content]. This way I can later refer the array object saying title[0] or content[2].
View 1 Replies
Jun 11, 2011
I have a small problem with iterating over array. I would like to iterate through items gathered in my array in a way of "one at a time" in each muse click event but whenever I'm using a simple loop it just takes all my elements to process. Is there a way to make a single iteration in each click and still increment the index value in loop?
View 5 Replies
May 19, 2007
I have a question about my xmlReader.as file about XMLReader class.this will be xmlreader class , but i can not take the data.
View 1 Replies
Oct 21, 2011
I am trying to communicate using this protocol. It works fine except when the socket has a lot of data to return. Right now I am checking if a packet ends with to determine if I have received all the packages. Problem is that sometimes a package can end with as a line break even if it is not the last package, so I can not use that.
I am using a command queue, because I want to wait for a complete response before sending the next command.
The code with unnecessary stuff removed:
class CustomSocket extends Socket
{
private var _response:String;
private var _commandQueue:Array;
[Code]....
The problem is in the function readResponse. I've googled a lot without finding anything of interest.
Is there a way to know the total amount of bytes/packets a socket will return? Or a way to detect EOF or that a package is the last?
View 2 Replies
May 20, 2011
I use this code to convert an image to a BitmapData and store a JPG in a ByteArray.
import com.adobe.images.JPGEncoder;
var jpgSource:BitmapData = new BitmapData (img_mc.width, img_mc.height);
jpgSource.draw(img_mc);
[code]....
Now, I want to do the following:
1. send the ByteArray to PHP;
2. PHP must store a physical image_id.jpg on server;
3. then PHP must return the URL of the image to Flash;
The first lines of PHP could be:
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// get bytearray
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
[code]....
View 1 Replies
Jul 10, 2011
I have an application that called a popup window. From this popup window is called the second window in which data is transmitted, such as an array of strings. In the second box, I can change the data in an array and return the modified data in the first popup window.I've tried:
FlexGlobals.topLevelApplication.myFunction(arrayWithData);
but of course get an error, because the data send to the main app. how to transfer data in the first popup window from a second?
View 1 Replies
Sep 23, 2011
I have flat data in my app which I will need to group, summarize, and count as I normally would with a sql query. For this project though, it must be done in the flex app. I need to figure out how to group my data by day or month using a datatime field in my Arraycollection, then appropriately count or summarize data in other fields. I've used Groupingcollections before, but only when binding to hierarchical controls (like AdvancedDataGrid and Tree), but I need a resulting ArrayCollection with the grouped and summarized data. Basically, I'm trying to access my AC like a sql table (GROUP BY MONTH(datetime), COUNT, COUNT(DISTINCT(), etc.) and I'm unsure how to do it.
View 2 Replies
Jul 18, 2010
I am attempting to build a generic XMLLoader class with a static LOAD method, with the intent to use it as follows...
private var _data:XML = XMLLoader.LOAD("path/to/xml_file.xml");
Then I could use it in any client and go-to-town with e4x.
The general problem I am having is with the URLLoader's COMPLETE event, which necessarily calls a different function to set the XML data.This is preventing me from being able to return the XML from the LOAD method, since the data is being set outside that function. Obviously I need to wait for the COMPLETE event in order to make sure the data is available.
I though, perhaps, I could create and return a _waitForData function, which recursively calls itself until the _data is set, then returns the data. But it seems redundant (since Event.COMPLETE is doing that anyway), and the way I tried it generates a stack overflow error.[code]...
View 2 Replies
Dec 21, 2011
I'm getting really annoyed by Flex. Is there a way to make it wait for an httpservice to get its data without having to use a timer?
At the moment my code looks like this:
protected function loginUser(event:MouseEvent):void
{
if(txtEmail.text == "" || txtPassword.text == "")
{
[Code].....
When I do user.login(), it sends a request with a HTTPservice from my external AS class. In the result event handler for this httpservice, I set a public variable to true or false, depending on whether the user's credentials are correctly in the DB.
I then use a getter to get that boolean value. However, without the timer, it always returns false because my code is faster than the event result handler. If that makes sense.
So I have to use a timer to stall my application for one second.. But seriously, that doesn't make sense to me. There has to be a better way, no?
View 3 Replies
Feb 19, 2007
Im trying to set up a class which will load xml and return data I can later parse with a parser class.
When I run the getRawData function from the fla, I get [type function].
[code]...
View 2 Replies
Oct 11, 2011
Is it ever preferred to not declare the data type of the return value of a function? Data type of return value is not declared:
[Code]....
View 2 Replies
Feb 11, 2010
How do you return data from a custom class, and only when something in the custom class has completed something. For example, let's say I have this code in the custom class[code]...
This, of course, doesn't work. I need the whatever.getLoadedObject() method to wait until the loading has finished inside the custom class then do whatever with the image loaded.
View 2 Replies
Jan 2, 2011
I've tried a couple different hash classes for as3. Right now I'm using the com.adobe.crypto package from [URL] What I need is a way to return the raw data as opposed the the hex converted string, similar the the way python's hashlib functions have a digest() and hexdigest() method. In python the code would be
...
single = sha1('some text').digest()
double = sha1(single).hexdigest()
...
In as3 using the following code returns a different hash because the return from the first hash is converted to hex before being hashed again.
...
SHA1.hash(SHA1.hash('some text'));
View 0 Replies
Dec 23, 2011
How can I return an object with an update data, that is pass in to a public static function?
GetDate.dayName(MyDate.setDate(1984,3))
//MyDate with new info (year, month) will be pass into GetDate.dayName
package hwang.time
[code].....
View 3 Replies
Feb 2, 2010
i want to ask : how can i send data from flash to php using as3 and receive data from php using flash and another question : how can i upload files using as3
View 4 Replies
Aug 23, 2010
I have a swf (swf#1) with links to another swf (swf #2). I would like use GET to pass data out of swf #1 to a PHP page that will be holding swf #2. I want swf #2 to start at a specific frame based on the data passed from swf #1.
View 1 Replies
Aug 21, 2010
I am trying to have the function toggleClick return powerData. I need to store powerData in a variable and have it passed to another function to do calculations.
Inside the function toggleClick, I am assigning powerData to houseArray[e.currentTarget.name.toLowerCase()];
var powerData:int = houseArray[e.currentTarget.name.toLowerCase()];
I tried just to write return powerData--but it breaks the program.
// function toggleClick
function toggleClick(e:MouseEvent) {
// Store "Power" Values of House Objects in Array
[code].....
View 1 Replies
Nov 1, 2010
I am making flash file with actionscript 2.0.If user input "domain name" in input text filed, I want to show its real ip address again. I found that I can use php function gethostbyname() to implement this.And I am trying to get return value from php using echo.But it does not get right value in dynamic text field.I also setup "always allow " in the global security panel.
View 2 Replies
Mar 25, 2011
I'm developing a flash user and pass login, and I want that when a user logs in, the data base returns the value of the path cell to flash. I managed to make the login work, but I didn't get to return the path value. My user and pass chart is like as follow:Quote:
id---user----------path----------------------passw
1---user1 --------/myfolder/myfile.rar --------helloworld
2---user2 --------/myfolder2/myfile2.rar------helloworld2
[code].....
View 2 Replies
Jun 14, 2011
I've been developing a framework for ActionScript 3 and have come across a peculiar scenario where I want a method to be able to return either an AvFrameworkObject or an Array containing multiple instances of AvFrameworkObject.[code]...
View 3 Replies
Jul 21, 2011
I have one function "Login" and function "_urlSended" inside of function "Login". So i want that sub function returned value as a parent function. I just want that script to work
<![CDATA[
function onButton1click():void {
Label1.text = Login('irakli', 'password1');
[Code].....
View 2 Replies
Sep 1, 2011
How can I return a value from AS3 to javascript. I am calling a AS3 method from JS and want that AS3 method to return back a string:
//javascript
var string = swfObject["abcmethod"](arg1);
The only way I know of is to add a callback method which is called from flash back in JS. Is there a better way?
View 1 Replies
Sep 18, 2006
Basically I have an XML doc with certain tags that contain true or false. Flash returns these as strings, even if I specificy the tag as a boolean. I've tried everything I know.
View 2 Replies
Jul 20, 2010
I feel like this should be correct but the trace always returns 'undefined'
PHP Code:
function loadXML(xmlFile:String):XML{ var xmlLoader:URLLoader = new URLLoader(); var xmlData = new XML(xmlLoader.load(new URLRequest(xmlFile))); return xmlData;}var xmlData:XML = loadXML("xml/nav.xml"); trace(xmlData.link.image.text() [0]);
[Code].....
View 5 Replies
Jan 31, 2003
I have a short Flash movie I made in Flash CS4. I figured out how to make the movie stop at the end so it won't loop forever, and I have a Replay button that appears and restarts the movie. But my directives have changed and I now need to know how to make the movie -- when it ends -- automatically go to and stop on frame 22 of the movie and also have that Replay button then appear when it does stop on frame 22. (Frame 1 through 22 is a gradual fade-in to the first scene, that's why I don't want the replay button to appear on frame 1).
View 3 Replies
Dec 11, 2009
I have a short Flash movie I made in Flash CS4. I figured out how to make the movie stop at the end so it won't loop forever, and I have a Replay button that appears and restarts the movie. But my directives have changed and I now need to know how to make the movie -- when it ends -- automatically go to and stop on frame 22 of the movie and also have that Replay button then appear when it does stop on frame 22. (Frame 1 through 22 is a gradual fade-in to the first scene, that's why I don't want the replay button to appear on frame 1).
View 5 Replies
Feb 6, 2010
I have an event listener applied to an xml load and it currently traces out the values it grabs which is fine, but what I want it to do is return an array for me to use. I have the Array creation and return working from "LoadXML" (it returns the array) but I can't get this to work with an event listener.The event listener runs the "LoadXML" function fine, but I have no idea how to take the returned array for use, this is an example of how my event listener works right now:xmlLoader.addEventListener(Event.COMPLETE, LoadXML());and my assumption of how I would take the array (this doesn't work):var rArray:Array = xmlLoader.addEventListener(Event.COMPLETE, LoadXML());so instead I tried the following:
xmlLoader.addEventListener(Event.COMPLETE, function():Array{
var rData:Array = LoadXML(datahere);
return rData;
[code].....
View 3 Replies