ActionScript 3.0 :: Using A Variable In A URL Request?
Mar 27, 2009
In AS2 to create a URL that would change depending on the current movie being viewed I would create variable and use this to make up the path, I can't get this working in AS3, what do I need to do to make this work?I have Code:var fileReq3:URLRequest=new URLRequest(currentPath);var currentPath:String = "mainImages/imageA.jpg";Then on my buttons I want to just reset the currentPath to image a b c and so on.When I publish my swf I get an error #2007 parameter must not be null
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.
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
I am trying to add a url request to a button when you hit it....
my AS3:
var WWbutn_req:URLRequest = new URLRequest("greatpricedfurniture.com/products/22722.html"); function WWbutn(event:MouseEvent):void{ navigateToURL(WWbutn_req,"_blank"); } WWbutn.addEventListener(MouseEvent.CLICK, WWbutn);
When I publish this I get 1023 Incompatible override and 1021 Duplicate function definition error...
I have an application developed in flash, and I need to access some php files. so the php file return some data if the access is came from swf. How can i identify if the request came from flash or not?
Found this code on the site from nunomira regarding URL request...code works, but when I try to duplicate it for 3 buttons hey go fritzy!Do I need something in between?
Home_btn.addEventListener(MouseEvent.CLICK,clickHa ndler1); function clickHandler1(event:MouseEvent):void { navigateToURL(new URLRequest("http://www.ebay.co.uk"));
I have a function where I load a xml into my project. Theproblem is that when I have edited the xml and run the functionagain to load the same updated xml, it just keeps on loading theold version. Is there a way to like delete history and start freshwith the load?
I have made an image upload manager. I made it initially in Flash Develop as an AS class. I need to convert it to a component in Flash Builder 4.5 It works absolutely fine as a .swf, but I can't figure out how to make the URL request work in Flash Builder. This is what I have between the tags:[code]I didn't put the mxml controls but there is a browse button (id="selects_btn") and a label (id="label_txt") under the button that displays various status messages.I tried adding the init function to the component's creationComplete event. I receive and error saying access of a null object.
I have a bit of code listens for a user to click a navigation item, however if they click another nav item then my code loads both of them and puts the content pages on top of each other.I am having loads of problems with this bit of code.
PHP Code: private function _menuSelectHandler (event : MenuEvent):void { if (! event.abstract) {
My web designer is no longer working and has left me with a flash file which would benefit from a small edit
The file is made up of a banner which rotates between 3 images. I'd dearly like each of the images to become a link to html files already uploaded to server
The banner can be seen at self catering accommodation belfast dot com
Is it possible to request this on the forum please?
I am trying to make a generic multiple choice quiz, with questions to be loaded from an xml file. The hope is that I can give it to teaching colleagues as a resource, and they can create their own questions by just altering the xml file, as none of them know how to use flash. I can make all of it work beautifully for just one xml file's worth of questions, but I'd like to enable people to save several different xml files with different questions, and choose which one to use in the first frame of my swf. Here's what I have in the first frame, where there is simply a text input box (inputxml) and a 'Go' button.
I know I can call my server directly from javascript. However, I want to do this through a non-GUI SWF file. I'm fairly new to Flash but have gotten all the CS3 tools from work. Does anyone know of any examples on:
1. how to make a web request from within flash provided the URL, post content, and timeout
2. how to call a Flash API from javascript asynchronously
3. how to detect whether the browser being used can support my SWF (I don't want it to prompt to install Flash if they don't have it yet)
I'm actually hoping someone has already done this and has a sample already built.
I just learned last night from Ned Murphy how to code a btn in AS3.Trouble is, when testing the Dreamweaver frameset website, site name: URLRequest on the C drive with my default browser F12, I get a problem loading the page / file not found.[code]Just for comparison here is the AS3 btn code Ned copy pasted to my Thread last night.[code]What is it that is stopping my browser from directing to "C:WebSitesFrameSetsURLRequestmainFrame1.html";Is it the var url:String?
Does anyone know of a plugin that when creating a new layer, the name of the layer is immediately editable or which brings up a dialog window prompting you to name it, as in photoshop and illustrator?
Say i have a SWF file loaded inside a Flash , which i do not have the source code for, and I want to redirect all the requests inside that SWF to another address(or block them, then read the request parameters and just send new requests with the exact same parameters from inside the container object). Is that possible? And if so, how? Once again, I do not have the source .fla for the files loaded inside the container, and recreating them from scratch is not an option. So this, to me, seems like the easiest way.
I've created an RSS reader by going through this very useful tutorial: http://www.webdesignermag.co.uk/blog/build-an-adobe-air-rss-reader.I've adapted it to my needs but now I'm struggling to add buttons to link to other websites. I've added 4 more buttons (link_mc_ videos, link_mc_images, etc) and added new variables (url2, url3, url4 + url5) but when I click on the buttons they all go to the first URL I specify - can anyone help? Here is my actionscript:
/* blog link */ link_mc.buttonMode=true; link_mc.addEventListener(MouseEvent.MOUSE_DOWN, linkMouseDown); function linkMouseDown(evt:MouseEvent):void { var url="http://www.popularmechanics.co.za/page/blogs"; var request:URLRequest=new URLRequest(url);[code].....
I'm in a bind with some work - I'm doing a quick day's work for a client and I need to convert some files from CS5 to CS4 so that I can work on them (I don't have CS5)If anyone's willing I'd be really grateful if you could convert these four files for me, saving them down to CS4.Url...I'm seeing the client tomorrow (Weds, UK time) so need to find a solution fairly quickly.If there's a way I can return the favour I will. eg some beer money via PayPal.
I have a flash file that sends some request to php file every 5 minutes. How can I check if the request from flash file has been sent from my website or from other place. I want to be shure that someone is not sending requests from other locations. It is very important for security reasons. Will the following PHP code work?
I'm writing a google gdata API client in Flash/AS2 (sadly, moving to AS3 is not an option at this time). Logging in via ClientLogin works fine but subquent requests will return a 302 redirect that includes a gsessionid I am supposed to include with future requests to avoid the 302s.
Flash/AS2, AFAIK, does not allow me to actually query an http error response body in any way, so there's no way for me to actually see this gsessionid after the 302 is returned. Is there a gdata api call which will return me a valid gsessionid inside an HTTP 200 response if I already have a valid GoogleLogin auth token, or is this not possible without a man-in-the-middle proxy?
In one web page we use a flash upload control but becouse a flash bug in the upload event the session is lost as its posted back with a new session. We have thought of using a table with ip and old session id or a query string with the old session id in order to reassign it in the uploaded event...Knowing the old session id how can i reassign it to the client? (In C#)
We are facing one issue directly connected with our Flash API we've given to a 3rd party flash vendor. To make a long story short, our API basically wraps domain logic on client and creates a single POST request towards the server in JSON format. All will be ok except in combination MacOS + Safari we receive double requests on server (?).
Even more interesting, we are receiving different agent names - one is expected name/decriptor of the browser and system, other is "CFNetwork". POST /RuntimeDelegate.ashx - 80 Mozilla/5.0+(Macintosh;+U;+Intel+Mac+OS+X+10_4_11;+fr)+AppleWebKit/531.22.7+(KHTML,+like+Gecko)+Version/4.0.5+Safari/531.22.7 200 0 0 POST /RuntimeDelegate.ashx - 80 CFNetwork/129.24 200 0 0 POST /RuntimeDelegate.ashx - 80 Mozilla/5.0+ [Code] .....
I tried using var params: Object = ((this.stage.loaderInfo) as LoaderInfo).parameters; to get the parameters, but it returns an Object with no properties. That LoaderInfo will give me the correct URL without the parameters though if I use LoaderInfo.url. I'm using the request: http://localhost/foo.swf?start=foobar. params.hasOwnProperty("start") returns nothing, and using a for loop shows that "params" has no properties. How do I receive the start/foobar pair in my code? I would much prefer to not use FlashVars due to our setup.