PHP :: How To Load SWF And Some Extra Data In Same Request

Oct 6, 2011

I'm loading a Flex 4.5 module (it's a SWF file) using a PHP code like this:
$module = 'modules/'.$_GET['module'].'.swf';
if(!file_exists($module)) {
$module = 'error.swf';
} $size = filesize($module);
$contents = file_get_contents($module);
header('Content-Type: application/x-shockwave-flash');
header('Accept-Ranges: bytes');
header('Content-Length: '.$size);
echo $contents;
And it works very well.

Now I want to get some extra data to load and populate the module with that data in just one request handler, something like:
private function requestHandler(response:???):void {
var data:Array = response as Array;
mySparkModuleLoader.load("", data[0] as ByteArray);
myController.load(data[1]);
}

I was trying to do it with AMFPHP but the ByteArray seems to be broken or something because it doesn't show up, but the rest of the data is fine:
return array(
'hello world!',
new Amfphp_Core_Amf_Types_ByteArray(file_get_contents($module))
);
Maybe creating a multipart response like [URL] and handling it?

View 1 Replies


Similar Posts:


Actionscript :: Flex - Passing Extra Parameter To Request When Using CallResponder

Nov 2, 2011

I am running flex with BlazeDS. My backend is in Java.

I have the following function in actionscript:

override public function execute():void
{
super.execute();
var responder:CallResponder = new CallResponder();

[Code].....

View 1 Replies

Data Integration :: Enable Data Management If Passing An Extra Variable To PHP Script?

May 7, 2010

Im trying to use dynamic SQL tables on my PHP server so I need to pass the table name to the PHP script.  I don't understand why the Data Management system that sets up CRUD won't allow this extra parameter.  It says it can only have one input: item. I can get all records, but when I try to create, update, or delete I get an error.
 
Or is there another way I can pass the tablename variable to the php file before I call any functions?

View 3 Replies

ActionScript 3.0 :: Getting All Of This Extra Space When Event.target.data Is Returned From Php?

Oct 16, 2009

k, so i have a function that checks to see if a user name and email that's being registered already exists in my DB. if the user name previously exists, a 1 is returned. 2 for email and 3 in neither previously exist. if i hard code my user name an existing user name, "joe", who already exists, into my php file and run it in my browser, i get an echoed answer of "1" as i should- nothing less, nothing more. if i don't hard code it and run "joe" over from flash and trace(event.target.data);, i get 1 with a bunch of carriage returns after it in my output window.

[Code]..

View 17 Replies

ActionScript 2.0 :: Load Xml With Extra Parameter When Embedding?

May 12, 2009

I have found out that one can use an extra parameter in the embedding in order to load another xml other than the default xml file:<embed src="veppa_photo_album2.swf?xml=path/to/custom.xml" ....</embed>I was wondering how i can read this xml file in flash.

View 2 Replies

ActionScript 2.0 :: XML Load Image - Use The Same File Though To Add An Extra Variable

May 25, 2007

I'm trying to modify an XML jukebox by adding an artwork functionality to it. The problem is that the jukebox is a component so I'm not able to pull it to pieces. I would like to use the same XML file though to add an extra variable (is that the right term?) called artwork. Here is the modified XML:

[Code]...

View 2 Replies

Limit Illegal Unusual Request For Data?

Jan 26, 2012

[code]...

The RD is just a number, but it was a malicious transfer up to 10GB of data, or very large data.

View 4 Replies

Flex :: Pass Request Data With URL Fragments?

Sep 1, 2009

I'm passing the following parameter as an url fragment to flex. (#groupID=2385)

This works great on the development box, but when I put it on the production server.. nothing.

Do you think this is a server configuration issue. I presume that flex is talking to the javascript file 'AC_OETags.js' to make this all happen.

View 1 Replies

Php :: Request Data In A Flash Movie At Run-time

Jun 9, 2009

Is it possible to request some data in a Flash movie from PHP at run-time? Maybe my real-world implementation can clarify some things:

I use a Flash movie to store a Local Shared Object (because for some reason I need LSO's instead or regular PHP cookies). Now, when I load up a PHP file I want to somehow retrieve the data from the LSO at runtime, assign it to some variables, and use the variables through the rest of the script.

View 4 Replies

Php :: Reading RAW Data From A Flash POST Request ( Images )?

Dec 8, 2009

I'm basically interacting with a third party API flash file to send HTTP POST requests to my server. know I'm on somewhat the right path because it requires a crossdomain.xml file, and before I added that part nothing in the POST variables was showing up, however since I added that file there are 4 variables that are set, these POST variables are sent by the application to give me basic information about the file.. but I actually need to read the RAW POST data to actually save the image being sent by the Flash.I'm aware there are 3 ways...$GLOBALS['HTTP_RAW_POST_DATA'] $HTTP_RAW_POST_DATA which is probably the same as the firstfile_get_contents('php://input')For whatever reason, neither of these "work". By "work" I mean they're not being set, when I var dump them I get nothing.

Could it be that there's a setting in php.ini that I need to set, or perhaps the Flash application is truly not sending the actual image? I think it's doing the right thing, because it's a semi popular API and it's used by a couple other sites so I'm pretty sure it's right on their end.

View 1 Replies

Actionscript 3 :: Flash / App Engine Request Data Encoding

Nov 12, 2010

I'm new to Flash and trying to communicate with an app engine server but I'm having some encoding problems. [code]This does not work, gives me some encoding errors on the server side. But if I switch POST to GET it automagically works.

View 1 Replies

Data Integration :: Sending XML Request To A Secure Server (https)?

Aug 30, 2006

am having this problem of sending XML request to an addresswhich starts with "https". The problem is I always get the errormessage "Error opening URL "https:......."", instead of the actualresponse which should be in XML format as well.The function I am using is "sendAndLoad()"requestXML and responseXML are objects of XML class . Whatfunction "sendAndLoad" above does is to post variables in the"requestXML" object to the specified URL "servelet_address". Theserver response is downloaded, parsed as variable data, and theresulting variables are placed in the responseXML object.However, as I stated above, I always get the error message.

View 2 Replies

Send Xml Data To The Server Using HttpService Request Thr POST In Flex?

Dec 12, 2009

send xml data to the server using HttpService request thr POST in Flex?

View 1 Replies

Flex :: Send HTTP POST Request With Binary Data In Body

Sep 17, 2009

I'm new to Flex and couldn't figure out yet how to send binary data to the server as the body of a POST request. The HTTPService component doesn't seem to support this. The FileReference doesn't seem to support setting the data via the Flex API.

View 4 Replies

Flex :: Access Data Field Of A JSON Request Send By Client In JAX-RS?

Feb 2, 2012

I have the following JAX-RS service.[code]...

The JAX-RS service receives the request and respond successfully with some dummy response, but I have no access to the request.data field.

How do I access the data of the request message (which is {"type":"get_configuration","data":"some data"} in this particular example)? I think that I'm supposed to add some parameters to the handleMessage method like

public SomeResponse handleMessage(Object message) {...

but this does not work at all. The request got 415 response.

View 1 Replies

ActionScript 3.0 :: Unload Child After A Load Request

Nov 4, 2009

I have a drop down box that is loading in different movies when selected.  But when I select the second option in the drop down box, the movie gets loaded on top of the next movie. I saw that there is a removeChild(), but i'm having trouble finding where to apply it in the code below? If I put it in the function, it creates errors of course.[cod]e....

View 3 Replies

Flash - Load A XML Via POST-request In Flex?

Feb 17, 2012

I'm trying to load a XML via POST-request in Flex:

var request:URLRequest = new URLRequest('res/unhasher.xml');
request.method = URLRequestMethod.POST;
loader = new URLLoader();
loader.load(request);

But in Firebug I see that my file is loaded through GET.

Request header:

GET res/unhasher.xml HTTP/1.1
Host: bla-bla-bla.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1

[code]....

How to make POST requests from Flash/Flex?

View 2 Replies

IDE :: URL Request - Load A DivX Movie Into A Swf Animation?

Nov 21, 2009

How do you load a DivX movie into a swf animation? I know this is how you load a swf.

[Code]...

View 2 Replies

Ajax :: Detect If HTTP Request Is From Browser / Flex Asynchronous Request?

Jun 1, 2010

When Flex application make an asynchronus HTTP request, does it add a special header to the request, like some JavaScript framework does? Something that indicates whether this request is an AJAX call/not.I just want my server side code to return different response format, depending on whether the request is made from browser/flex.

View 1 Replies

Data Integration :: SendAndLoad XML Request That Works Perfectly But Inside Of Any Browser It Stops ?

Sep 20, 2006

I have a simple sendAndLoad XML request that works perfectly on 95% of the computers I have used. I have check crosssite stuff and everything i can think of. Its not browser specific ,os specific, or flash version specific. On these computers I can run the same flash file on a standalone player and everything works flawlessly but inside of any browser it makes the request for the XML file and stops right there. After a while like 10 minutes flash gets tired of waiting and returns not found. I can navigate to the xml file via the same browser. Upgrading Flash doesn't help.The only thing consistent is it only happens to windows computers. The requested URL is the complete URL. I have changed this and still the same.IE or Firefox still the same. Version 9 player in both. I have montiored network traffic and see the request made and maybe a response but flash has moved.

View 1 Replies

Php :: Send POST Request With X-amf (Flash) Request Header?

Apr 13, 2011

I'm trying to reproduce a POST request that was captured from WireShark using PHP. This POST request was sent by a Flash (.swf) object, so it's a little bit complicated in configuring the header.It does not print out anything in the end, so there must be something wrong with PHP code that I could not see.Here is what WireShark captured:

POST /engine/ HTTP/1.1

Host: abcdef.com

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[code]....

The result is a blank page instead of response from server.

View 1 Replies

ActionScript 3.0 :: Image Gallery Doesn't Recognize Load Request?

Feb 5, 2010

I'm trying to create a five image gallery, and when I try to add the load request for the 3rd, 4th, and 5th images I get an error message that says it doesn't recognize that request: see code below:

stop();//turn on buttonMode for mc's so mouse changes to handone_mc.buttonMode=true;two_mc.buttonMode=true;three_mc.buttonMode=true;//four_mc.buttonMode=true;//five_mc.buttonMode=true;////--add button modes for 3-5 here////define

[code].....

View 1 Replies

ActionScript 3.0 :: Make A New Request To The Server If The Seconds Parameter Specifies A Time Outside Of The Currently Buffered Video Data

Jul 14, 2011

when uing netsream.seek(), how can i make a new request to the server if the seconds parameter specifies a time outside of the currently buffered video data. I want to seek unloaded time

View 3 Replies

ActionScript 3.0 :: Falling Snow To FALL - 1087: Syntax Error: Extra Characters Found After End Of Program. OnClipEvent (load)

Nov 18, 2011

I have tried this tutorial at: [URL]. I'm using Flash CS4 on the MAC. But when I run it, nothing happens, When I run the test movie I get an error: 1087: Syntax error: extra characters found after end of program. OnClipEvent (load) {

Also, it doesn't say in the tutorial, so I created a new layer first and then dragged the snowflake symbol onto the stage and then added the script to it. (now there are 2 layers on my timeline). Although it doesn't say to make a new (2nd) layer. Surely you can't do everything on the same layer, because you need to add 2 different scripts which you can't do to one layer.

View 3 Replies

ActionScript 3.0 :: Set Up URL Request To Load External Image For Drag / Drop Object?

Feb 26, 2011

I would like to know how to set up the URLRequest to load an external image to a movie clip that is being used in a Drag and Drop event.I have successfully implemented the drag & drop code to my design but I would like to improve it by successfully loading external images to those objects that are being dragged around.I have both Var Load and starDrag codes. I am trying to figure out how to combine them.

View 3 Replies

ActionScript 1/2 :: "POST" JSON Data In The Body Of A Request With LoadVars?

Mar 10, 2009

Is it possible to "POST" JSON data in the body of a request with LoadVars? I understand LoadVars sends data as name>value pairs. How can I send the data in the body instead?

View 1 Replies

AS2 :: Post JSON Data From Flash With The JSON As The Body Of The Request?

Nov 5, 2010

I'm working on a Flash AS2 application that needs to post JSON data to a web service.In previous projects, I've used LoadVars.send() or LoadVars.sendAndLoad() successfully to manage this:

var send_lv:LoadVars = new LoadVars();
send_lv.data = JSON.stringify({some json object});
var response_lv:LoadVars = new LoadVars();
response_lv.onData = function(rawdata) {

[code]....

In somepage.php, I can grab that JSON data using $_POST['data'].However, on this project, the developer of the web service requires the JSON content to be the BODY of the request (i.e., not a name/value pair). Is this possible with LoadVars?

View 1 Replies

ActionScript 3.0 :: Error "Ignoring Cross-frame Javascript Url Load Request By Plugin"?

Mar 14, 2011

I have this code in my html

function open(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir){
var opciones = "fullscreen=" + pantallacompleta + [code].....

And I call it from as3 like this:

var request:URLRequest = new URLRequest("javascriptpen('+ prop.link +',0,1,1,1,1,1,1,800,500,0,0,1);");

navigateToURL(request);

But when I click to open the new url.. chrome brings me this log error "Ignoring cross-frame javascript url load request by plugin"

View 1 Replies

Data Integration :: Use Flash To Dynamically Load XML Data Via A FlashVars Call In The HTML?

Jul 18, 2007

Im new to placing external data into Flash. I just got CS3 and Im trying to use Flash to dynamically load XML data via a FlashVars call in the HTML.

The problem is I have followed the very straight forward AS2 Help files for using FlashVars and URL variables.I have placed the code directly from the Help file into the Html between
<noscript> <noscript>and i keep getting undefined.I have tried saving the file as flash 8 and i am publish flash 8.

View 1 Replies

Flash :: Data Integration - Xml.load() Failing - Passing All Of The Data Via A Query String Appended To The Movie's Url

Sep 5, 2006

We have implemented a Flash photo slideshow on our site and it works just fine for most of our users. Whenever the xml.load(success) returns false I have the Flash email me a debug report. For the life of me I can not find a common thread between all of these people having problems with the Flash. I don't think it's a cross-domain issue because it works for most people, and I have the crossdomain.xml files where they should be.

[Code]...

View 1 Replies







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