ActionScript 3.0 :: Url Request And Rel Attribute?
Oct 15, 2009Anyone know if its possible ?
so I want the equivalent of
<a href='large_map.php' rel='ibox&fullscreen=true' >
Id rather not use a js call if I dont have to.
Anyone know if its possible ?
so I want the equivalent of
<a href='large_map.php' rel='ibox&fullscreen=true' >
Id rather not use a js call if I dont have to.
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 RepliesI'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.
I am having trouble parsing some xml that has a few attribute names with : characters in them. The compiler is not throwing any errors and when I trace my complete xml object out it is all there, however when I try to trace out any element or node it keeps comming up undefined. I removed the attribute names with : characters in them and everything works fine. I cant seem to target the attributes either to delete them.
View 3 RepliesI have been trying to figure out how you could add in custom attribute tags that flash can recover.
EX:
<param name = "movie" value = "somefile.swf">
<embed src = "somefile.swf" width = "550" height = "400">
Except, that I would like to add a Custom tag, like "randNum" so that the tag user could input some number, or rather, a flash movie could generate a tag with a number already put in...Basically, heres a really basic version of the idea.There is a Flash Movie.In the movie, you can input text into a textfield.Upon finishing your message, you click a button "save".
The flash movie then:
1. Comes up with a random number unique to the message.
2. Assigns that number to a variable... "randNum".
3. Saves message as a xml file to the server as "filename" + randNum.
4. Outputs into a textfield a generated HTML tag that a user can post on myspace and such so that it will load in the flash movie.
Except... in the tag, there will be a custom attribute. If the random number variable "randNum" was 00112233, the custom attribute will be 00112233.
EX:
<embed src = "somefile.swf" width = "550" height = "400" randNum = "00112233">
So when the movie opens, it retrieves that randNum from the tag and can use it inside flash. How can this be done? Sorry this post was so long, but I wanted everyone to understand the concept.
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?
without passing get/post variables to php.
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"));
[code]....
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?
View 2 RepliesThe buttons are not clickable and need to be. see test page here: [URL]
View 2 RepliesThe targets only work and will go to the specified page in my ie browser. Does anyone have a fix for this. Code below.[code]
View 2 RepliesI have a Flex service defined like [code]...
View 2 RepliesI 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.
View 2 RepliesI see this example here: [URL]
Which looks pretty good. But the loader seems overly complicated. What if I don't need to listen for a response? Can this be simplified?
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
View 8 RepliesI am on AS2.0, CS4:i am trying to extract the following data from the XML attribute:[code]i tried to load the xml attributes into the two separate dinamic text fields:[code]
View 8 RepliesI am trying to get the value of an attribute full where another attribute name is equal to something e.target.name.
So in this case I am trying to get the value of "full"
var full_url = myXML.item.@full.(@name=="e.target.name");
This is my XML:
<item name="Toy Box" thumb="resize/thumb_image2.png" full="full_images/image2.png" />
<item name="Toy Train" thumb="resize/thumb_image3.png" full="full_images/image3.png" / >
<item name="Toy Truck" thumb="resize/thumb_image4.png" full="full_images/image4.png" />
So my as above should return one of the But when I trace full_url I get nothing and no errors.
I have this XML
<language lang = "ru">
<ru>language/ru.xml</ru>
<ua>language/uk.xml</ua>
[code]......
I have some xml that is full of attributes. Without much detail, i would like to translate the xml into objects. However , i need a method that can get the attribute values AND names. Getting the value is a no brainer, but the names are not coming so easy. For example, the following will translate and xml node into an object with a prop and value of the same[code]...
View 1 RepliesI need to be able to dynamically get the name of an attribute in AS3. So for example:
Code: Select all<setup<animation speed=".5" />
<animation transition="saturation" />
<animation easetype="linear" />
<animation clickthrough="true" />
[Code]...
I'm updating an old AS2 project and have a question about XML. This thing I'm working on uses two xml files, pics.xml and lang.xml. The last one of the two contains translations for the flash file and looks like this:
PHP Code:
<lang> <trans lang="sv"> <nextPic>N�sta bild</nextPic> <prevPic>F�reg�ende bild</prevPic> <showMap>Visa karta</showMap> </trans> <trans lang="en"> <nextPic>Next picture</nextPic> <prevPic>Previous picture</prevPic> <showMap>Show Map</showMap> </trans></lang>
and in the pics.xml you choose what language to display by setting an xml attribute to either "sv" or "en".My question is, how do I tell the function that parses lang.xml to only parse the node with the right language. If "sv" is set in pics.xml I only want to parse the first bit om lang.xml there, you se what I mean? I don't what to use something like: this.firstChild.childNodes[0].blahblah cos most likely the users of this will ad more languages...
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) {
[code].......
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.
Actionscript Code:
stop ();Go.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);var chosenFile:Stringfunction fl_ClickToGoToNextFrame(event:MouseEvent):void{Go.removeEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);
chosenFile = inputxml.text;
nextFrame();}
[Code] .....
I have just changed over from Flash Pro 8 to CS5, and AS3 is still a bit new to me - am I doing something really daft?
I finally got my buttons to work, but now I need to get them to open in the same window. As of now each button opens a separate new window.
View 2 RepliesI 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?
View 3 RepliesDoes 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?
View 2 RepliesSay 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.
View 1 Repliesfrom within a browser this will work:
function bobhome(evt:MouseEvent):void{ var urlRequest:URLRequest= new URLRequest ('home.html'); navigateToURL (urlRequest, "_blank"); }
this will not:
function bobhome(evt:MouseEvent):void{ var urlRequest:URLRequest= new URLRequest ('home.html'); navigateToURL (urlRequest, "_self"); }