ActionScript 3.0 :: Linking To URL's Using Var Request:URLRequest?
May 23, 2011
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].....
View 8 Replies
Similar Posts:
Mar 13, 2012
Below code is used to read a file in the disk and upload as 1MB chunks to a php server via adobe AIR application.It iterates the do/while loop till the end of the file and uploading part is handled by function getConnection. The servers returns an XML as the response.With the eventListnters currently it goes to fuction onRequestComplete when it recieves the response. Because of that issue current code exits the loop when it receives the response from the server.Is there any way that I can get the responce of the request send by the function getConnection when it calling inside function startUpload ? also hw can I define the request timeout for this single requests?
private function startUpload():void {
var localFilePath:String =localFilesToUpload[currentUploadedVideoIndex].file.nativePath;
var filePathArray = localFilePath.split("/");[code]......
View 1 Replies
Aug 12, 2009
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.
View 9 Replies
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
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
Jul 28, 2009
the project im working on is all database driven, there are no html files and all coding that is created is made by php then stored within a db to be called later on. now because of this i can't use relative links at all with anything i.e. images, videos and swf files.
so.....i am using swfobject to link to a swf file using absolute linking as shown in the coding below. but what i need to do now is link an .as file in my swf using absolute linking so i can call some arrays from the file.i have doubled checked to make sure my vars can be passed by local testing and it works but now i need it as absolute....is this possible?
View 16 Replies
Apr 28, 2010
I have the following actions in my file :
var xmlLoaderA:URLLoader = new URLLoader();
xmlLoaderA.addEventListener(Event.COMPLETE, LoadSomething);
xmlLoaderA.load(new URLRequest("my url"));[code]....
now imagine that the loading of the file is completed and we are in the "LoadSomething" function. How can we trace "my url" in this function? In another word I want to wite this action:
trace(Command);
and I want "my url" string in output.But I dont know what is the Command.
View 1 Replies
Dec 27, 2011
During development I have to test using several different hosts. It is a pain to have to change the IP address everywhere I use navigateToURL or in an mx:HTTPService. I would like to set a var with the IP... public var hostIP:String = "192.168.1.100"; Then later I instead of doing...
[Code]....
View 2 Replies
Sep 26, 2009
working my way through some tuts, and have set up WAMP. Trying to send some vars from AS3 to PHP to update a mtySQL table.My issue is that the php file does not seem to be receiving the variable info from flash, why not?
Here is the AS code
Code:
submit_btn.addEventListener(MouseEvent.CLICK,onClickSubmit)
function onClickSubmit(event:MouseEvent):void
{
var loader : URLLoader = new URLLoader();
[code]....
The PHP works cos when I run it from a browser $sd3 updates the database field to 78.This the output of the 'trace' statements
clicked
sd1=77&sd2=88&nickname=test1
The reason is probably simple but I can't see it.
View 1 Replies
Nov 2, 2009
I cannot ascertain why the code for one set of navigation buttons I've created works, but similar code does not. The code is rather lengthy, but I've pulled out the salient components to see if the Interwebs could help.
Here's the script that IS working:
Listener code:
Code:
cswordbutton.addEventListener(MouseEvent.CLICK,fetchcswordassets);
And the function code that goes with it:
Code:
function fetchcswordassets(e:MouseEvent):void{
var url:String = "knowntomeURL";
[Code].....
1) All of the actions are in a separate layer in the first frame;
2) There is only one scene;
3) I've given the same button a different instance name in many cases, to coincide with different expectations (URLs).
View 4 Replies
Jul 30, 2009
i have this code
public class TextboxXML extends Sprite
{
[...]
//XML[code]....
i want to get the xml-data. the xml will be generatet out of a php-function.testing it out of flash by "testing the movie" (apple+return), the php will be parsed and it works. when i test it on my lokal server, the same smf i mean, nothing happens.
View 2 Replies
Oct 20, 2009
I have an xml file which contains multiple products each with their corresponding background image, foreground image, text and website. The LoadXML class loads this xml file and creates an array of each image, text and website. The Main class then loads each image from the array of background images in the method onBackgrLoad(). This is done through the use of a for loop which loops through the array of backgrounds (called hintergrund[]) and loads each one in turn. On tracing hintergrund[] I sucessfully receive a string of all the different background image paths. However when I examine the backgrRequest and backgrLoader they both contain null. The images therefore dont appear on stage but neither does an error message appear! The same thing happens for onImageLoad (this should load the foreground image) and onTextLoad.
public class Main extends Sprite
{
//____________________________________________________________________________Vars : Newly
[code].....
View 6 Replies
Dec 21, 2009
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.net.URLRequest;
[Code]...
View 1 Replies
Nov 12, 2009
fla files which is calling default page . but it's not able to find the default page.. my default.aspx page is in root directory ,and my fla file is in ../capture/image.fla . here is my code
[Code]...
View 2 Replies
Apr 24, 2010
can I make role based authorization when sending requests to an ASP.NET MVC backend system. I am calling action methods and expecting JSON results, however, some action methods are decorated with the [Authorize] attribute, others require some role privileges to be present. I certainly hope that passing authorization data with every request is possible
View 1 Replies
Jun 29, 2011
i use LocalConnection between two swf in the same page.What i'm trying to do is to use a String sent from one swf to the other, as variable into my URLRequest...So i can trace "myVar" into the function chemin, but i didn't find how to use it into URLRequest
swf that receive the var :
var lc:LocalConnection=new LocalConnection();
lc.client=this;
lc.connect("callBig");[code]....
View 2 Replies
May 4, 2010
i have a menu with 9 buttons, every button take me to one gallery.i already do the gallery, and works fine in a button. but i wanna know if its possible change the urlrequest of the xml for every button.
[Code]...
View 1 Replies
May 20, 2010
I've got code to stop an arrow and stop an animating photo attached to btnStopMems simple button. Now I want to also have the same button pull a new URL and go to that page.[code]...
View 4 Replies
Oct 28, 2010
Try to set the timeout for my URLRequest via
Code:
var tempURLRequest:URLRequest = new URLRequest (path);
tempURLRequest.idleTimeout = 2000;
But it doesn't work. Thus: How can I set/change/get the timeout for URLRequests? I need this since I start many parallel URLRequests and on slow connections I get an IOError URL not found error due to the long time they are on stack (I assume).
View 0 Replies
May 14, 2009
I'm working to gain some proficiency in communicating flash and php. I recently found this nice method to feed variables from php into flash. I'm using http_build_query() function in a php file to send some variables like this:
[Code]...
View 4 Replies
Oct 20, 2009
An xml file contains multiple products each with their corresponding background image, foreground image, text and website. The LoadXML class loads this xml file and creates an array of each image, text and website. The Main class then loads each image from the array of background images in the method onBackgrLoad(). This is done through the use of a for loop which loops through the array of backgrounds (called hintergrund[]) and loads each one in turn. On tracing hintergrund[] I sucessfully receive a string of all the different background image paths. However when I examine the backgrRequest and backgrLoader they both contain null. The images therefore dont appear on stage but neither does an error message appear! The same thing happens for onImageLoad (this should load the foreground image) and onTextLoad.
[code]...
View 1 Replies
Jan 14, 2012
I used to have this code when I had the files implemented in the app.
PHP Code:
private function saveFile():void{var sourceFile:File = File.applicationDirectory.resolvePath("Content/sounds/" this.name".mp3");
[code]....
View 5 Replies
Feb 4, 2009
this piece of code:
PHP Code:
var mySoundReq:URLRequest= new URLRequest("samplesound.mp3");
var mySound:Sound = new Sound();
mySound.load(mySoundReq);
How does the urlrequest know where that .mp3 file is located, and how do i tell as3 where it is? and another thing: when i put this on the web, how do i locate the file then?
View 6 Replies
May 18, 2009
I'm retrieving variables from a DB via PHP via the URLRequest, and the formatting is set to variables (URLLoaderDataFormat.VARIABLES) and matches the structure "myVarName=myValue&myOtherVarName=myOtherValue&... ".
My question is; is there a way, within Flash, to identify the variables and their values, without having to know their names?, are there methods within the loader class that allow this?, such as the variables count etc?
(I can access the variable "copyrightTxt." via the syntax: loader.data.copyrightTxt because I know its name, but I'd like something like
loader.data.variableSent[45].name = "copyrightTxt"
and
loader.data.variableSent[45].value = "@ 2009"
and
loader.data.variableCount = 98
View 3 Replies
Jun 1, 2009
Can I send and load variables to a php script on a different server? Hen I try I get a Error #2048: Security sandbox violation How do I get around this?
View 14 Replies
Dec 25, 2010
I'm figuring out a way to reload my entire SWF file from only AS3. I'm using the URLLoader and URLRequest method. When I run the SWF and execute the code, error 1009 keeps popping up
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Projectile3()[D:OliphantProjectileSimulation3Projectile3.as:1 07]
From the error, line 107 in Projectile3.as is causing the error. The line is:
var fps:int = stage.frameRate
I need to reload my flash file because as I simulate the projectile path, I also create a sprite that draw the trail of the path. I tried to remove the path using removeChild(trail) but as soon as I addChild(trail), the previous trail appears. The only way to completely remove the trail is by reloading the movie.
View 4 Replies
Aug 29, 2011
I am using new URLRequest to load a page. I cannot seem to get it to load in the current page rather than create a new page. Here is my code;
Actionscript Code:
home.addEventListener( MouseEvent.CLICK, function(e){ navigateToURL( new URLRequest('http://www.site.com/page.html') ); } );
View 6 Replies
Jul 20, 2006
I get the following errors when I try using URLVariables andURLRequest. Can anyone tell me what I'm doing wrong ?The class or interface 'flash.net.URLVariables' could not beloaded.var params:URLVariables = new URLVariables();The class or interface 'flash.net.URLRequest' could not beloaded.
var request:URLRequest = new
URLRequest("upload_process.php");
View 1 Replies
Oct 29, 2010
I try to set the timeout for my URLRequest via Code:var tempURLRequest:URLRequest = new URLRequest (path);tempURLRequest.idleTimeout = 2000;But it doesn't work. Thus: How can I set/change/get the timeout for URLRequests? I need this since I start many parallel URLRequests and on slow connections I get an IOError URL not found error due to the long time they are on stack (I asume).
View 3 Replies
Feb 11, 2011
i have imported an image using actionscript using urlrequest.i have set its x and y bu the image is to big, i want to resize it, i have tried the height and widt but it doesnt work
View 2 Replies