ActionScript 3.0 :: How To Chage The Urlrequest Of An Xml
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.
I am loading an external image into AS3. The image comes in quite large, and I am simply trying to make it 200h x 200w. In AS3 using FlashCS3, you can do this:
Code: import fl.containers.UILoader; var myLoader:UILoader = new UILoader(); myLoader.height = 200; myLoader.width = 200; myLoader.load(myImage)
That works fine in AS3 using FlashCS3, however is not supported in FlashCS4. Why? Who knows, but my guess is that there is another simpler way to do it, even though you can't get much simpler than that. I have tried using the standard loader:
Code: var myLoader:Loader = new Loader();
and tried to change the dimensions, but it was a no go. Also tried making a movieClip and a Sprite and loading the image into them and changing their dimensions, but then the image disappears entirely and doesn't work.
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.
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.
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...
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
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).
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.
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
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
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
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]....
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]...
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).
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:
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.
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?
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
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?
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.
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");
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).
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
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 am loading an image using Loader class and with URLRequest, but for some reason I am struggling to reference a file in a sub folder of the root (where the SWF is exporting to) this is local testing and I am assuming that if I refer using an absolute path on a web server it would work - but I do prefer to use relative paths for simplicity.I get the above error, but I know that the file name is correct as moving it to the same folder as the SWF works fine - but in implementation should I wish to organise hundreds of JPGs and create a gallery it would be a bit messy to store them at root level. As mentioned previously I am working on a local drive at present, and have no plans to move to a web server as this is just a test file for my own learning purposes.i have tried "folder/filename.jpg" and even on the unlikely side "folderfilename.jpg" and even further far-fetched "../rootfolder/folder/filename.jpg".The only issue is the path, I am sure of it - but the filename is correct.
I am sending userID through urlRequest like below code,
[Code]...
now when new window is opening in that new swf is opening(new project) that is also in flex only.there i need to retrive userID when initailizing only how can i retrive?