ActionScript 3.0 :: Sending Headers With URLRequest?
Dec 3, 2010
I'm trying to load XML data from a PHP file. How can I send data to the PHP file in the same request before I load the data?
ActionScript Code:
var loginXML:XML;
var loginVars:URLVariables = new URLVariables();
var loginSend:URLRequest = new URLRequest("savexml.php");
var loginLoader:URLLoader = new URLLoader;
I am writing a flex3 tool for our uber-geeks. The tool is for futzing around with sharing URLs to various various social sites.
private function submitRequest(evt:Event):void { var requestURL:URLRequest = new URLRequest(constructURL()); requestURL.method=URLRequestMethod.POST;
[Code].....
I can call an external javascript function that will do a post, but however the XmlHttpRequest infrastructure only want to setRequestHeader(key,value), and seems to need to be from a very specific list of strings. setRequestHeader("foo","bar") did not add a foo header in my outgoing request.
There does not seem to be a way to add the header meta tag. via javascript. Or at lease I am not finding it off of google.
I am using Flex 3 (ActionScript 3.0). I use the HTTP progressive download to play sound files. I want to secure the sound files, by only serving them when the request comes from my flex app. I chose the simplest solution of adding a HTTP header to each request send from the app. But flash.media.Sound object ignores the headers set in flash.net.URLRequest. Here's an example,
URLRequest sndFile = new URLRequest("http://blah.com/media/load_sound.php"); sndFile.requestHeaders = new Array(new URLRequestHeader("req-orgin", "myflexapp")); Sound snd = new Sound(sndFile); snd.play();
The value of req-origin comes as null in load_sound.php. When i inspect the request using Firebug, the request headers to [URL] doesn't contain the header.
I am facing some issues sending byteArray as part of my URLRequest data to a cfm page.I need to send an collection of objects as part of byteArray.But when i try doing so,i get illegalArgumentException.I am doing it this way
var obj:Object=new Object(); obj.name='Mike'; obj.age='26'; var byteA:ByteArray=new ByteArray();
[Code].....
Secondly when i tried sending xml obj as part of ByteArray,It worked fine ,but i get unwanted characters appended at the start and end of the xml.
In my movie i have a link button with following, simple, function creating a link:
[Code]...
lately i've associated a class file (.as) to my movie and immediately after, when publishing the movie i got the following error message: 1046: Type was not found or was not a compile-time constant: URLRequest. as well as a couple of other related error messages: 1180: Call to a possibly undefined method URLRequest. 1180: Call to a possibly undefined method navigateToURL. when i remove the link to the class file, the problem goes away. also, i have checked the class file for mentioning of "URLRequest" and nothing is there.
I've be messing around with Flash for a little while now and just recently starting trying to do a datagrid which is loaded from an XML file. Well I've gotten the XML to populate the datagrid. Everything is fine in that aspect but I cant seem to get my text to align properly in the datagrid. By default ofcourse everything is aligned Left. I would like align everything centered (the cells as well as the column Header.The code that I have basically creates the datagrid at runtime,
Note: I had found two other threads from a couple of years ago that said use the line below, but I've tried that line of code to no avail:
Code: myDataGrid.getColumnAt(2).textAlign = "center"; HERE IS MY CODE: Code: import fl.controls.DataGrid;[code]....
Basically I am trying to forward a download to another URL but at the same time I need to be able to set headers like "filename".
The readfile($file) function will not do it for me, because the the $file is not stored on the same server as the PHP script (not even the same datacenter) Is this even possible ? If not via PHP, maybe FLASH could do this ?
I dont want to make hboxes with labels and all for static headers in tile list... IS there a shortway to put column headers in a tile list in flex easily?
Is it possible to read HTML headers in AS3?The header contains the following meta tag:Code:meta name="language" content="en-GB" scheme="rfc1766" />The idea is to extract the following code into a variable to control the language in the swfCode:content="en-GB"Is this possible in AS3?
I am in the process of writing an application in Flex 3.3, using the Cairngorm framework, for deployment as an AIR application. The application heavily utilizes RemoteObject services to get data from a web server.Each of my service delegates extends a common class which provides a method for calling service methods on the RemoteObject.So, where I previously usedServiceLocator.getInstance().getRemoteObject('myService').myOperation.send();I instead usethis.send('myOperation', 'myService');I use this method instead of calling the RemoteObject operations directly because this method adds another, global, responder to the operation call. This extra responder analyses data in the headers of reponse from the server.
Or at least it should -- this is where the problem is. In the result data (event as mx.rpc.events.ResultEvent) the headers property is always null despite the headers definitely being sent from the server.
I am trying to extend the DataGrid to allow headers for different groups of rows. However, I cannot figure out which method to extend from DataGrid that would allow me to accomplish this. I do not want the headers to be included in the dataProvider, only the rows. I want to specify indexes to insert the headers at using a property of the custom datagrid. Here is a quick photoshop showing what I am trying to do: Is there any custom component already built that will do this?
I am trying to use the Quickbase API (see reference below) with a POST. I am having trouble forming it; specifically, I am clueless as to how to format the header (headers=""). I think the XML Payload is correct, but who knows.
Quickbase API reference: Example XML Request POST /db/6c5xatxy HTTP/1.0 Content-Type: application/xml Content-Length: 88 QUICKBASE-ACTION: API_GetRecordInfo [Code] .....
I have been trying to customize the datagrid component. So far I have been able to customize the cells using a custom cellRenderer. I would like to change the way the header looks by using a custom headerRenderer as well but from all the ones that I have tried to make don't work.[code]to try and set the headerRenderer class that I created to the datagrid name dgPL. But it doesn't work. From what I have found on the internet the headerRenderer class is suppose to act just like the cellRenderer class in design and implementation. I can't find any examples of people using a custom headerRenderer class or examples on how to make one.I have gone wrong in designing my class or implementing it into my program would be appreciated.Also I am trying to figure out how to add a Marquee to the cells of the same datagrid so that if the content in the cell is too long for the size of the cell it will scroll across the cell when the user rolls over the datagids list of content. The part I am having trouble with is figuring out how to get the new string assigned to the cell without permanently overriding the dataprovider's content for that specific row in the datagrid.
From my looking on the internet I have found a way to create a marquee for textFields. What I can't figure out is how to apply it to the datagrid itself.[code]Right now the marquee works by creating a textField and doing the marquee that way but that isn't the most effective way of doing it at all due to allignment issues when scrolling the content in the datagrid.I know how the Marquee works I just don't see how to apply this marquee to the datagrid cells itself. I know how to grab the content of my cell's with no issues at all and how to redefine it for the marquee to work I just am not sure how to assign it back to the cell itself without overriding the dataprovider permanently.
Is it possible to create Accordion with only the headers without adding any containers in it? Is there a way so that I can just create the Accordion with three sections with only labels?
I've been using Claudio's tutorial titled "Preloader & Transitions for Dynamic Files" and everything is working okay except for one minor detail. First off, what i am doing is loading external SWF headers on my site. Each of these headers are animated. Once the Transition Shutter Mask closes and loads the next header, it starts playing the external header animation immediately rather than waiting for the Transition Shutter Mask to fully open and then start playing the animation.
So as a result, users are missing the beginning parts of each animation. Also, I noticed that after I uploaded it to test the preloading, I missed more of the Header Animations due to the loading time difference. This means that I can not just insert the exact amount of blank frames, in which the shutter takes to close, to the beginning of each header animation.
I currently designed a website for my client in wordpress with rotating banner headers. The website theme is space and astronomy, hence my client wanted banners about space shuttles and galaxies etc. I have been able to do this .. but with one small hitch the banners are in the size of 50-70 KB each. You can check out the website at -[URL] What I wanted to know is
1. Is there a wordpress plugin which installs adobe flash on the website? 2. Will making the banners in flash reduce the load time? 3. Will using flash affect the user experience as I believe many mobile brosers and iPad's do not support flash?
via an SWF file, what request type would "http://url-to-my/json.script" receive. It doesn't seem to be a "xmlhttprequest". Is it the same as a request from a browser?
I'm using URLLoader to POST to a server. The xml response from the server can respond with a 404 or a 403 (forbidden) error. However I am unable to get the response codes.
Here is the code
var urlString:String = "some url"; var urlRequest:URLRequest = new URLRequest(urlString); var loader:URLLoader = new URLLoader();
[Code]....
status is always 0 regardless whether i return 200, 400, 404, 301, 500, etc...
is it possible to write new id3v2 tags to a mp3-file through actionscript? Normally you can read/write tags like artist,album,genre...But I would like to add for example the tag "atmosphere = smooth".
I almost got it, but the part that's giving me trouble is making the header background transparent. I am making a custom MXML skin based on the default Spark DataGrid skin. I tried setting the contentBackgroundAlpha to 0 on the columnHeaderGroup and the headerRenderer, but that didn't work. I tried setting visible to false for either of those, but that made it so that the text didn't show up either, so that didn't work. There is no setting for backgroundAlpha in either of those two, so I'm not sure what else to try.
I've been using Jumpeye Accordion Panel V3 at some projects and this time a client asked me to make one where he will add a list of projects and as time goes on he will add pictures for all or most of them. So, I need to know if there's a way (in the component itself or with a code snippet) to make the panel open only the titles that have a corresponding image entered in the external .xml file. Those that have no image shouldn't be clickable and shouldn't open a blank gap. Tried using a transparent 1x1 gif but it looks real bad as it opens a lot more than 1 pixel height