Actionscript 3 :: Http - Class That Fetches The Content From URL And Returns It?
Jun 22, 2010
Is there a standard class that simply returns the response received from a URL given a URL?
Looking through the documentation, I found mx.servicetags.HTTPService, but I don't think it's what I'm looking for.
Update: The request is happening inside of a function and therefore that same function has to return the result. In other words, callbacks aren't going to work.
I can get which part of file in bytes is loaded using videoDisplay component for RTMP protocol for VOD, I can get the current playing position using videoDisplay.playheadTime. But I want to know how many seconds of video are already loaded (not the length of bufferTime, which remains constant). i used videoDisplay.bytesLoaded when using RTMP it returns nothing ,if we uses HTTP it displays number of bytes loaded
The loaded size in bytes is not directly proportional to running time of the video, and while using rtmp im unable to get bytesLoaded too, how i can calculated the Video already loaded.
Im building a reservation form, using actionscript and php. I use sendAndLoad to send variables to php via POST, which returns a different HTTP POST response in case of sucess or not.
Is there anyway to "read" HTTP POST responses with actionscript?
i want to serve world clock into my SSL enabled website. when i use http chrome browser shows mixed content "this page include other resources which are not secure" [URL]already try SSL proxy to display clock but no luck:[URL] this shows Clock fault. Undefined!also uploading that flash clock into web server and undefined error also occur.is there anything should i try or any recommendation ssl enabled clock similiar to worldtimeserver to use?[URL]
When a flash player is being hosted on https server, can I pull content to play on it from an http server. Would this work or give a mixed content warning or some other problem?
I have written a ToggleButton class - a button that toggles an object implementing an Itoggleable interface - a reference to which is stored in the ToggleButtons 'target' property. Toggleable contains a reference to an instance of whichever ToggleButton it is a target of.Now, I can easily create this relationship like so:
1118: Implicit coercion of a value with static type org.ngfl.template.ui:ToggleButton to a possibly unrelated type ToggleButton.this seems to be saying that the 'this' reference is not returning the instance of the class but the class itself, am I right? Is it not possible to do what I want? It's only one extra line but I'd prefer it that way.
I have a load file and a write to file method. We all know what they do. How ever load always returns true and write always returns false....Right there you know somethings wrong. Because The forums have an issue with me posting code...I posted it here: [URL] Based on this code what is the issue here? why is write always returning false and why is load always returning true? (even for files that do not exist). My understanding is that if flash cannot find the file it should write to it will create it and if it cant load said file, then that method should return false.
I did a separate levelData class to be able to flexibly add levels. I was happy with it until my supervisor ordered me to convert my levelData into XML. I did an XML version of the levelData's data (question, answers, correct answer...). I used the old class and converted it so that it fetches the XML.
All seems well, I did traces of my answers array and it printed nicely...
But the headache started when I tried this.
// This code appears in a different class with // currentLvl:LevelData initialized in the constructor. quizHolder.ansA.ansHud.text = currentLvl.choices[1];
I am trying to call a method that has some xml functionality and It keeps coming up null.What I am trying to do is; I have a page that has four dynamic text fields that get their content from an xml file. I would like to create a method that will output the contents to display in the dynamic field. Maybe my approach is WAY off here, but my supervisor wants all xml related tasks contained in a xml.as fileMain.as
I'm doing some calculation with numbers and would like to only print an integer (the number without the decimals).I thought that the toFixed() method of the Number class would do the trick, and it does most of the time. But quite frequently strange values are returned. Here are 2 examples:
Number(0.002).toFixed(0) returns "0." while Number(1.002).toFixed(0) returns "1" (without the period) Once in a while, Number(0.002).toFixed(0) returns "1"
Needless to say that's not the expected behaviour. Am I not using this method correctly?
*edit: I know I just have to do int(0.002) to get 0 but I'd like to understand that strange behaviour.
I'm trying to retrieve that mediator on another page like so:
var navPageMediator:NavPageMediator = facade.retrieveMediator(NavPageMediator.NAME) as NavPageMediator;
However, that statement returns null. If I try to cast it using the NavPageMediator(facade.retrieveMediator(NavPageMediator.NAME)) syntax instead, I get a TypeError: Error #1034: Type Coercion failed: cannot convert com.website.mvc.view.page::NavPageMediator@237560a1 to com.website.mvc.view.page.NavPageMediator.`
I can't, for the life of me, understand why NavPageMediator@237560a1 would be unable to convert to NavPageMediator, nor what happened in between registering the mediator and retrieving it that caused this. Especially since trace(new NavPageMediator() as NavPageMediator); returns [object NavPageMediator].
Incidentally, and this may be part of my problem, I don't understand what the @hash at the end of the object is (@237560a1). Is it simply an internal identifier for that class instance?
Edit:Left a bit of important info: The SWF in which I instantiate and register the mediator is separate from the SWF in which I try to retrieve it.
A web channel streaming service streams to a certain IP range, it only checks the IP in example.com/cmd.php?id=xxx (channel number) and outputs an rtmpe stream URL, nothing else.How do I trick it to get my local URL instead of the one on their server? I have considered squid proxy, but is there some way to do it with a firefox plugin or greasemonkey script?
Edit:I will try to specify:It's a streaming service from an ISP and cable provider. They stream for free to people on their IP's. On their webtv page, which is called webtv.example.com, there is a flash player. If you are not on an IP from their ISP, you can't stream anything but the test channel.When you try to change channel via. javescript:videoplayer_changechannel(xxx) it makes this HTTP request:
[URL]
If you are on one of their IP's you will get an RTMP URL, like this:
[URL]
This is what the flash player requests, and if it get's this response it load the channel requested. There is no HTML on the php page, just the URL. Note that the rtmp URL is static.If you are not on one of their IP's it will return a random sentence (something stupid, the programmers having fun).I wan't to trick the flash player into getting the right value, even though it's not on one of the ISP's IP's.
I'm having with a menu navigation system. I'm using Flash MX. I have created a menu system for the site I'm building ([URL]) where one of the buttons "Choose photographer" drops down a list of names. All the other buttons just jump to another page. The drop down is currently using tweens also the logo moves to the left as the dropdown appears and returns when the dropdown returns. All working fine apart from its a bit jerky.
It's I just wanted to get away from tweening and use action scripts instead, as I'm a newbie to all things Flash I trawled the net for tutorials and examples so that I could cobble together the exact same effect. I have managed to get the drop down work and return using the action script and it does seem smoother and works slightly better. But can I get the logo to move to the left and back in time with the drop down...no.
So I want to read http streams using flash tcp sockets. I do not really need the http header at all - all I need is body which contains flv. so how to read http response body into byte array using flash sockets?
Code: function loadMap():Void { varxdata:XML = new XML(); xdata.ignoreWhite = true;
[Code]....
Now, im creating a local variable var var_temp:String; cause, there is no way that i can pass the values, inside the onLoad handler to a property of the class.
If i try some this.some_var its reference to escope inside the onLoad handler..
I have a "master" SWF file into which I load content (other SWFs) via the Loader Class (with code below). var contentLoader:Loader = new Loader();this.contentContainer.addChild(contentLoader);I load the content (these other SWFs) into a MovieClip container on the stage called "contentContainer". The "contentContainer" is much smaller than the "master" SWFs stage and also much smaller than the original size of the SWFs that the Loader is loading in. Also, and this is very important, the "contentContainer" itself is sized -- not scaled -- (see code) and placed on the stage depending on how large the stage is scaled (I am trying to make one of those "liquid stage" flash sites that fills the browser window with flash content regardless of window size).//this resides in a function that is called whenever the stage RESIZE Event is fired
I found it is very useful to load a swf into AS as class (what Embed metadata did). However, I am in trouble to do exact the same thing to content that is not load in compile-time (Loader and URLRequest). How can I do that?
I have (for example) font embeder class, and I want to load external SWF not from application storage folder, but another local path ( "D:lah-blah123.swf") in AIR, but as you understand I can't find any decision on the Internet (Google, [URL])
I have a problem with my New Loader class I use as3 and buttons to load external files into into my main swf file and I resize the external files to match my stage but they always load from the top left at x=0 y=0 The action script i use is
var swfHolder = new Loader(); mybutton_btn.addEventListener(MouseEvent.MOUSE_DOW N, mousedownpresser); function mousedownpresser(event:MouseEvent):void { addChild(swfHolder) swfHolder.load(new URLRequest("myvideo.swf"));
Is there any way I can load the external files into a different position?
I have a pageflip project and have 15 swf. Some of the swf which having the image content are loading(fliping effect) too smoothly , but if the swf having text content are loading very slowly.
var ocf:Object = PageFlip.computeFlip (this.pageCorner.clone(), this.lastFlippedCorner, this.width/2,
I am extending TextField to create my own implementation of it, and there are some properties & methods I would like to simply remove from use, eg:
override public function setTextFormat(format:TextFormat,[...]):void{}
I would like now to hide setTextFormat from code hinting, so when, in some other class, I type:
var t:MyTextField = new MyTextField; t.set
And hit ctrl+space I only see setPropertyIsEnumerable(...) and setSelection(...), no trace of setTextFormat(...). But no matter what I do it still appears, I tried @private metatag in asdoc, as well as some made-up (like @remove, @disable, @ignore, @deprecated). Using [Exlude] doesn't work either as, afaik, it works only with mxml. Is there some way to actually accomplish this task? Or am I forever left with useless and redundant code? Some plugin maybe? (I know I can just leave it as is and don't double methods, but, nevertheless, I'd rather have it my way)
The first on is using the Tweener class and everytime that I press a button it fades out the loaded content of the previous selection, waits for it to finish and then loads the content of the button pressed. Everything works fine with this part. The second code is the on that is using an Array to dynamicaly rollover, rollout and keep selected the buttons.It was also changing the content of the mc that everything is loaded on but without this fancy fade in - fade out...!!
i've got a fair bit of text i'm trying to keep on an internal page by just making each section a scrolling content box. So there are 3 buttons at the top, each 'scrolls' onto a new section and I would like the ability for it to scroll back too, hence using the tween class to do this. I've managed to set it up and each button goes to each 'page' fine in reading order, so to speak (1, 2, 3), but if I got to 1, 2 then back to 1 it will start from 0 on the x axis.
Basically what i'm wanting to do is set the tween from the current _x value. So if I go 1, 2, then back to one, it will take the current _x value from 2, and scroll the opposite direction back to one. I am using the following code on the buttons:
I'm have made some buttons (movie clip) and when I click on it, I want a file (home.swf) to load in a loader (mx.contents.loader) and I want the other buttons to do the same, all load into the same loader. I have no Idea how to do that. The way I have it set up now, the home.swf will load over the entire screen and that is not what I want. I just want the content to load into the loader and have its content change once I click on the other buttons. Here is a copy and past of that I have at the moment, I'm using Flash 8 to do it all.