ActionScript 3.0 :: Send Array Using AMFPHP And Get It Back - Returns Null

Jan 3, 2010

I am new to php and specially AMFPHP, now all I am trying to do is send and Array to PHP using AMFPHP and get it back, but it returns "null";.

Code:
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Main extends Sprite {
[Code] .....

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Array Pop Function Returns Null

Jul 25, 2010

ActionScript Code:
public function draw():Card{
return deck.pop(); //deck = array of Card
}
Does not work. Firstly it runs an error which says
"cannot convert [] to Card"...
Shouldn't it pop() return just ONE element?

Then I correct like this
ActionScript Code:
public function draw():Card{
return deck.pop() as Card;
//deck = array of Card
}

And now I get no errors but the function returns null.... why? If I try this:
ActionScript Code:
public function draw():void{
trace(deck.pop());
//deck = array of Card
}
It prints [Object Card] which is how it should be ....

View 9 Replies

Flash :: Calling AMFPHP From Red 5 Returns A Long Double?

Mar 3, 2011

I'm running the latest build (I'm pretty sure it's 1.0) on Ubuntu and I am calling a function on an amfphp service on another server. Everything seems to be in order, but I am getting a strange return value using the following code:

String url = "http://path.to.our.server/gateway.php";
RemotingClient client = new RemotingClient(url);
Object[] args = new Object[]{"Hello world!"};
Object result =client.invokeMethod("service.manager.say", args);
if(debug) System.out.println("return from server: "+result.toString());

View 1 Replies

IDE :: Possible To Send Or Get An Image Or Swf Using Amfphp

Apr 12, 2007

i want to use amfphp to get a very long text so i want to be able to show the progress of the download with a preloader but i dont know how to do this, also i dont know if it is posible to send or get an image or swf using amfphp.

View 4 Replies

Actionscript 3 :: Connect To AMFPHP - NetConnection.connect() Returns TypeError: Error #1009

Dec 8, 2011

UPDATE: Now I've moved the AMFConnection var declaration to outside the functions in Main, and commented out some trace() commands, and now it gives new errors:

Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion
at AMFConnection/init()[/Users/Jan/Downloads/amfphp1/AMFConnection.as:32]
at AMFConnection()[/Users/Jan/Downloads/amfphp1/AMFConnection.as:23]

[code]...

I'm trying to connect to AMFPHP on a server (with Flash AS3), and the swf borks when it reaches the .connect() stage. To make things easier (?) and more reusable (?), I've put all the NetConnection mechanics into a separate class, AMFConnection, which I call from the Main document class like this (details changed):

public function testConnection(e:*=null):void {
var conn:AMFConnection = new AMFConnection();
conn.table = "some_table";

[code]...

AMFConnection actually starts the connection and calls the AMFPHP service with the function gogogo(), and here's where the connect() NetConnection function just won't work. Here's the main section of the AMFConncection class

private var _netConnection:NetConnection;
private var _responder:Responder;
function AMFConnection()

[code]...

It also fails to display the stage, instead showing the loading dots. Now, eventually I'm going to move this application to the same server as the AMFPHP service, but even when I try it there with a relative url, instead of an absolute one, it still breaks down at connect(). I've tried changing the publish settings from local only to network only, to no avail.

View 3 Replies

ActionScript 3.0 :: Send Data With Amfphp To A Database?

Jul 22, 2009

I have been looking everywhere for this solution:

How do you send data to a database using amfphp?

Do you need to use a php file or something? or is there a way of doing it another way? I'm not great with php..

View 1 Replies

Actionscript :: Read Content Of File With Php And Send To Flex Via Amfphp

Nov 19, 2009

I am creating some application in flex and one of my purposes is to read content of file and display it in flex. There is huge problem, when I have file written in polish (which contains some special characters) because amfphp transfers this contents few seconds, which is to long (reading and sending content of file without any polish character if fast).My php code reads any files fast, so problem is on amfphp side. Is there any solution or I have to go with HTTPService and load contents of file directly from flex?

View 1 Replies

ActionScript 2.0 :: Send List Of Variables From Php To Flash And Send Back Random Selection To Php?

Nov 16, 2010

I'm looking to send a list of variables (say 6 in total) from php to flash and for flash to pick a random one and send it back to php when clicking a button.

I would like it to appear in a dynamic text box. That randomly selected variable needs to be sent back to php on pressing a button.

View 2 Replies

ActionScript 2.0 :: Send List Of Variables From Php To Flash And Send Back A Random Selection To Php?

Nov 16, 2010

I'm looking to send a list of variables (say 6 in total) from php to flash and for flash to pick a random one and send it back to php when clicking a button. I would like it to appear in a dynamic text box. That randomly selected variable needs to be sent back to php on pressing a button.

View 6 Replies

Professional :: GetCharBoundaries Returns Null?

Mar 2, 2011

trying to cut text field to single letters and then do some animations on each letter. But, how do I know where to place (position) the letters? I tried using getCharBoundaries but once it reaches 3rd line, it keeps returning null values. Anybody knows why that happens

View 3 Replies

ActionScript 3.0 :: Function Always Returns Null?

Apr 25, 2011

I've got an object inside an object. The child object basically loads a variable from SQL into one of it's own public variables. The SQL works 100%, because it traces out correctly.Now I've wrote a function from the child.as

Code:
public get_var() : String
{
return var_yes_friggin_work;[code].....;

Of course the files arn't called Parent.as and Child.as I've just had to rename them because our work is monitored though checking the internet and I can't delete this form.The FilePathOriginal doesn't output anything unless the string is manually set from the child, does anyone know where I'm going wrong here? (I can't upload all my code because of the monoriting process)

View 10 Replies

XML :: Flex - ArrayCollection Children Returns Null

Aug 12, 2009

I have an ArrayCollection with following structure (when viewed in debug mode):
[0]
- [0]
-- src
- [1]
-- src
src is the path to an image.

I need to get all of the src's out of the arraycollection. However because of the first (unnamed) node I can't take them in. I've tried ArrayCollection[0].children and save the result in another ArrayCollection, however the new ArrayCollection has 2 Objects in it but no 'src'. There are just 2 null objects
firstArrayCollection is filled with the data as described above.
secondArrayCollection.addItem(firstArrayCollection[0].children);

When viewing the content of secondArrayCollection i see following structure (and data):
[0] null
[1] null

View 1 Replies

Java :: GravityManager.getGravity() Returns Null?

Feb 27, 2012

I'm trying to implement Gravity from GraniteDS. I did everything like in example from GraniteDS website, but when I'm trying to get gravity from servlet context, ravityManager.getGravity returns null. Here is the code: Gravity gravity = GravityManager.getGravity(contextManager.getServletContext());What can be the reason of this error?

UPD:
From web.xml:
<servlet>

[code].....

View 1 Replies

ActionScript 3.0 :: Resursive Function Returns Null?

Oct 29, 2009

I have created a Composite Pattern type structure, with TreeNodes and TreeLeaf Objects.I works fine, except when I seach in the treestructure for TreeNodes and TreeLeafs in a resurve function with a loop, the function returns null - even on a successfull match.

public function traceTree(inComponent : TreeComponent = null) : TreeComponent{
var parentComponent : TreeComponent = inComponent;
if(inComponent == null){

[code]........

View 4 Replies

ActionScript 3.0 :: DropDown Returns Null Error

Feb 2, 2011

I'm making a list of alarms to pick from. I've googled for answers the past two days but I cannot figure out what my problem is with this batch of code.

I've got 7 items in the menu and the dropdown works good as long as you do not select the item that is already displayed in the menu. You can select another item and then reselect the original item, but I get error "Cannot access a property or method of a null object reference." from

[Code]...

View 0 Replies

ActionScript 3.0 :: Global Var Returns Null In TextField

Aug 13, 2010

I have a small issue, which is important for my project though. Namely my global var returns null when I need it. I have a global var class:
Code:
package {
public class Global {
public static var premiseGlobalName:String = new String();
}}

In another class I'm setting this var like so:
Code:
public function onButtonRollOver (event:MouseEvent):void {
Global.premiseGlobalName = "My home";
this.addChild(premiseMenu);
}

The second line in the method calls another class to the stage which uses the global var. I trace the global var:
Code:
public function initPremiseMenu():void {
trace("GLOBAL: " + Global.premiseGlobalName);
}
But it returns an empty value.

I want to use the global var in a textfield like so:
Code:
premiseTip.text = Global.premiseGlobalName;

View 7 Replies

ActionScript 3.0 :: Flash Facebook API GetFriends Returns Null

Jul 6, 2009

private function getFriends(thisSession:Facebook):void {
getFr = new GetFriends();
var thisCall:FacebookCall;
thisCall = thisSession.post(getFr);
[Code] .....

View 8 Replies

Flex :: SetFocus To TextInput Field - Returns Null

Jul 3, 2009

I have an app where I am looking to make the enter key act like a tab key. I can easily capture the keypress event and setFocus to a textinput field. The problem is figuring out which textinput field to give focus to. I have this code

trace(this.window.focusManager);
//returns TheWindow86.focusManager
trace(this.window.focusManager.getNextFocusManagerComponent());
//returns null
//This is what I was hoping would work
this.window.focusManager.getNextFocusManagerComponent().setFocus();

The code is in a controller class and "this.window" references an instance of a nativeWindow mxml file "TheWindow.mxml". The first trace works as expected, but the second one gives null.

View 5 Replies

Actionscript 3 :: Casting An Object Using 'as' Returns Null MyObject?

May 3, 2010

I am trying to create a custom object in AS3 to pass information to and from a server, which in this case will be Red5. In the below screenshots you will see that I am able to send a request for an object from as3, and receive it successfully from the java server. However, when I try to cast the received object to my defined objectType using 'as', it takes the value of null. It is my understanding that that when using "as" you're checking to see if your variable is a member of the specified data type. If the variable is not, then null will be returned.

This screenshot illustrates that I am have successfully received my object 'o' from red5 and I am just about to cast it to the (supposedly) identical datatype testObject of LobbyData:

[Code]...

View 4 Replies

Actionscript 3 :: Facebook Api: GetSession() Returns Null For User Name

Nov 2, 2010

I'm starting a facebook app using iframe method.I am using flex and so far I am able to connect to fb (login and out). Now I am trying to retrieve current logged in user name. In the document I see this function is what I need. Facebook.getSession().A tutorial in adobe site uses desktop api and it works for desktop (AIR app) but not for web app. (yes, i fixed Facebook.getSession() instead of FacebookDesktop.getSession(); Also, I am able to see the uid but not the user. User returns null. uid is a string and user is an object. But on the desktop app,FacebookDesktop.getSession().user.name returns the name perfectly. but on the web, it does not.

View 2 Replies

Flash :: Flex - GetApplicationVersion() Always Returns Null Version?

Feb 8, 2011

I'm currently working on a Flash application that has a sibling AIR equivalent. From inside the Flash application I would like to install the sibling AIR App. Adobe has provided an air.swf (which is also used in the Badge sample) to aid us with the install. I've managed to mimic the behavior of the Badge app butgetApplicationVersion always returns null. Note that I do not have a publisherId. Here's the documentation provided by Adobe: Installing and running an AIR applications from a web page

Air application XML:
< id >MyAirApplication< /id >
...

[code]......

View 1 Replies

Arrays :: Accessing Variable From Other Class Returns Null

May 10, 2011

I did a separate levelData class to be able to flexibly add levels. I was happy with it until my supervisor ordered me to convert my levelData into XML. I did an XML version of the levelData's data (question, answers, correct answer...). I used the old class and converted it so that it fetches the XML.

All seems well, I did traces of my answers array and it printed nicely...

But the headache started when I tried this.

// This code appears in a different class with
// currentLvl:LevelData initialized in the constructor.
quizHolder.ansA.ansHud.text = currentLvl.choices[1];

[Code].....

LevelData Class in PasteBin: [URL]

View 2 Replies

ActionScript 3.0 :: XMLLoader Class Returns NULL In Flash?

May 2, 2008

So I dived into AS3 and decided to create an XML Loader class.

Code:
package
{
import flash.events.Event;

[Code].....

View 7 Replies

ActionScript 3.0 :: FlashVars Root.loaderInfo.parameters Returns Null?

Jul 29, 2010

I continue, I must say I've searched on forum and on google and all the different kind of code didn't work On my actionscript panel, I have this:
 
import com.greensock.*;import flash.net.URLRequest;
import flash.display.Stage;import flash.display.LoaderInfo; 
var sujet_no:String = LoaderInfo(this.root.loaderInfo).parameters["sujet_no"];var timer:String = LoaderInfo(this.root.loaderInfo).parameters["timer"];var back_url:String =

[Code]...

View 7 Replies

Flash :: Calling A Method In Custom XML Class Returns Null?

Sep 7, 2011

I am trying to call a method that has some xml functionality and It keeps coming up null.What I am trying to do is; I have a page that has four dynamic text fields that get their content from an xml file. I would like to create a method that will output the contents to display in the dynamic field. Maybe my approach is WAY off here, but my supervisor wants all xml related tasks contained in a xml.as fileMain.as

package classes
{
import flash.display.*;

[code]....

View 1 Replies

ActionScript 3.0 :: GetBmpData Returns Null When The SWF Is Accessed On The Remote Server?

Mar 17, 2010

The Document class loads a list of external bitmap images. As the images are loaded, the following takes place for each:

Code:
var obj:Object = new Object();
obj.bmpData = bmp.bitmapData;
obj.bmpFilename = bmpFilename;
bmpDataList.push(obj);

As you can see, an object is created and the bitmapData is stored inside of it. This object is added to an array.Later, when a key is pressed, a new instance of a class is created. A function is called that retrieves the appropriate bitmapData and this is passed to the constructor of the new instance. Example:

Code:
//Instance is created:
var newChar:BaseChar = new LowA(getBmpData("a"));[code]....

The problem is that getBmpData returns null when the SWF is accessed on the remote server. Result = no images seen. It works just fine locally.

View 1 Replies

ActionScript 3.0 :: MC On Button State Returns Error #1009 - Null Object Reference

Sep 10, 2009

I have a button at the start and end of a short timeline, it works fine. But when I add a simple MC to the up state of the button, flash gives me this error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at BtnWithMCinside_fla::MainTimeline/frame18() The 'mc within a button' method has worked great until that button is placed beyond the first frame. why this is happening and how to fix it? (SWF attached)

View 4 Replies

Actionscript 3 :: Casting A Retrieved Mediator With PureMVC As Its Proper Class Returns Null?

Jul 15, 2010

I have a mediator that I've registered for a navigation page:

facade.registerMediator(new NavPageMediator(viewComponent));

I'm trying to retrieve that mediator on another page like so:

var navPageMediator:NavPageMediator = facade.retrieveMediator(NavPageMediator.NAME) as NavPageMediator;

However, that statement returns null. If I try to cast it using the NavPageMediator(facade.retrieveMediator(NavPageMediator.NAME)) syntax instead, I get a TypeError: Error #1034: Type Coercion failed: cannot convert com.website.mvc.view.page::NavPageMediator@237560a1 to com.website.mvc.view.page.NavPageMediator.`

I can't, for the life of me, understand why NavPageMediator@237560a1 would be unable to convert to NavPageMediator, nor what happened in between registering the mediator and retrieving it that caused this. Especially since trace(new NavPageMediator() as NavPageMediator); returns [object NavPageMediator].

Incidentally, and this may be part of my problem, I don't understand what the @hash at the end of the object is (@237560a1). Is it simply an internal identifier for that class instance?

Edit:Left a bit of important info: The SWF in which I instantiate and register the mediator is separate from the SWF in which I try to retrieve it.

View 1 Replies

Flex :: If HTTPService.send() Gets Called Before A Previous Call To It Returns A Result

Jan 28, 2010

I have an HTTPService that executes the dataLoaded(e:ResultEvent):void function whenever it gets a result from a send() call. OK so If I call HTTPService.send() and then call HTTPService.send() again before the previous one receives a result, I end up repeatedly running dataLoaded() which is undesirable What I want is if HTTPService.send() gets called before a previous call to it returns a result. I want to cancel the first call, and only process the result from the last call to HTTPService.send()

View 4 Replies

ActionScript 3.0 :: Access Array Object With AMFPHP

Jan 29, 2010

I have an array in AS3 that I am sending to AMFPHP

Code:
var myArray:Array = [
{type:"text", title:"title 1"},
{type:"video", title:"title 2"},

[Code]....

In my PHP function I need to loop through the array and get to the objects

PHP Code:

for ($i = 0; $i < count($myArray); $i++){    $type = $myArray[$i]['type'];    $title = $myArray[$i]['title'];} 

The above doesnt appear to be working. AMFPHP is returning this error:

Code:
Cannot use string offset as an array

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved