Actionscript 3 :: Understanding An AMF Polling Call

Sep 19, 2011

One of my testers is asking me about an AMF polling that we do in our app:[code]They are seeing values of 0 and 5.

View 1 Replies


Similar Posts:


Flash :: Long Polling With URLStream?

Jun 27, 2010

I'm trying to open a connection to a URL that will periodically send over a JSON object. I know that I need to use URLStream and some event callbacks, but I'm in the dark when it comes to knowing how streams of data "work," or the general flow of operations. Assume I know how to open the connection and send the correct request headers. First, some relevant code:

[Code]...

View 1 Replies

ActionScript 2.0 :: Polling UI GoTo Different Frames?

Dec 23, 2009

This is one of those rich media interactive ads, that have the ability to launch another SWF using _root.myPR.openPanel(1); The user has 3 choices identified as option1, option2, option3. I would like to not just openPanel on pr_submitBtn.onRelease, but to have the panel open & advance to a particular frame depending on which option the user chooses in the poll. I have the following launching the panel but not going to different frame labels in the panel launched. All 3 options simply stop on frame "one".

Code:
if (option1 = true) {_root.myPR.openPanel(1, "one");
}
if (option2 = true) {_root.myPR.openPanel(1, "two");

[code].....

View 3 Replies

Video :: Overhead Of Using EventListener Versus Polling?

Jun 30, 2011

So I have streaming video coming in, and I want to know when it is buffering. This is fundamentally not that hard, just adding an EventListener for some type of buffering event, but I was wondering if this is necessarily the "best" way to do it.

My other thought was setting up a timer that polls the video feed every X milliseconds asking it if the video isBuffering(), or somesuch. While I could, in the worst case, wait the full X milliseconds before querying the video stream, I've decided that this doesn't actually matter to me; I can work around it, and indeed do so quite naturally already.

So I'm asking: is there substantial overhead involved in having an EventListener (assuming I already have quite a few), or is the advantage of catching the buffering event right away sufficiently appealing?

View 1 Replies

Actionscript 3 :: Memory Leak In Server Polling Presentation App?

Feb 22, 2010

I'm building a remote presentation tool in AS3. In a nutshell, one user (the presenter) has access to a "table of contents" HTML page with links for each slide in the presentation, and an arbitrary number of viewers can watch the presentation on another page, which in turn is in the form of a SWF that polls the server every second to ensure that it's on the right slide. Whenever the admin clicks a slide link in the TOC, the database gets updated, and on its next request the presentation swf compares the label of the slide it's currently displaying to the response it got from the server. If the response differs from the current label, the swf scrubs through the timeline until it finds the right frame label; otherwise, it does nothing and waits for the next poll result (a second later).

Each slide consists of a movieclip with its own nested timeline that loops as long as the slide is displayed. There's no actionscript controlling any of the nested movieclips, nor is there any actionscript on the main timeline except the stop();s on each keyframe (each of which is a slide in the presentation).

Everything is built and working perfectly. The only thing that's troubling is that if the presentation swf is open for long enough (say, 20 minutes), the polling starts to have a noticeable effect on the framerate of the movieclips animating on any given slide. That is, every second, there's a noticeable drop in the framerate of the animations that lasts about three-tenths of a second, which is quite noticeable (and hence is a deal-breaker for the whole presentation suite!).

I know that AS3 has issues with memory management, and I've tried to be diligent in my re-use of objects and event listeners. The code itself is dead simple; there's a Timer instance that fires every second, which triggers a new URLRequest to be loaded by a URLLoader. The URLLoader is reused from call to call, while the URLRequest is not (it needs to be initialized with a new cache-killing value each time, retrieved from a call to new Date().time). The only objects instantiated in the entire class are the Timer, the URLLoader, the various URLRequests (which should be garbage-collected), and the only event listeners are on the Timer (added once), the URLLoader (added once), and on the routines that scrub backwards and forwards in the timeline to find the right slide (and they're removed once the correct slide is found).

I've been using mr doob's stats package to monitor memory usage, which definitely grows over time, so there's gotta be a leak somewhere (it grows from ~30 MB initially to > 200 MB after some scrubbing and about 25 minutes of uptime).

View 2 Replies

ActionScript 3.0 :: Polling With URLLoader Gives Sporadic IoError #2032?

Jul 8, 2008

I have a flex app that polls a php script every 1-2 seconds and returns new data. The polling is done with a URLLoader.load call;the requests are HTTP GETs. The app listens for Event.COMPLETE, handles the incoming data, waits for 1 second, then makes another URLLoader.load call.

This process works perfectly for any duration from 4 to 20 minutes. Eventually, a URLLoader.load call fails to return Event.COMPLETE. Instead it hangs for 60 to 180 seconds (depending on which local network I'm using for internet access) and finally returns an ioErrorEvent.IO_ERROR with the message "Error #2032: Stream Error. URL: <mysite.com/foo.php". The app tries to make another URLLoader.load call, but from this point onward, none of the loads return Event.COMPLETE. Also, none of these post-error HTTP GETs appear in the access.log file of my apache (2.0.55) webserver. The app will not work again until I close and reopen the browser.

I've spent several days trying to figure this out! The time until the app crashes appears to be completely random. The problem occurs in both Firefox (2.0.0.15) and IE (7.0.5730.11). I've read that sometimes 2032 errors can be related to caching, but there's no directives (in .htaccess file or httpd.conf file) that sets the Pragma or Cache-Control response header to "no-cache".

I can't tell if the problem is on client or server end. Based on the adobe language references and the forum posts I've read, this seems to be an appropriate use of URLLoader. (In case you're wondering I want the app to respond to events in near real-time. I originally used xmlsocket to push data to app from server. However, this communication is blocked by corporate firewalls, so I need an alternative method)

Here is (cleaned up) code:

[Code]...

View 1 Replies

Actionscript :: Flex Long Polling (server Push) Without BlazeDS?

Oct 19, 2009

Apart from using BlazeDS, are there any pre-existing libraries that implement long polling (or server push) in Flex?I've read I like to implement Flex to Server comet / long polling for games, but he's only asking if it's possible to implement... Not if implementations exist.

View 2 Replies

ActionScript 3.0 :: Understanding Mc.name.slice(5 - 9)

Oct 21, 2011

This may be a bit of an easy question for some, but I'm having difficulty understanding what mc.name.slice(5,9) does. What is this name slice bit about?

View 5 Replies

MX04 Understanding 'for' Loop Iterations

Mar 25, 2009

How come every time I run this script:[code]Where does the Undefined come into things? I have only asked the script to fire 3 times so the first time through the text in position [0] in the script Carp should be printed out?

View 2 Replies

Flash: Understanding Program Flow?

Mar 9, 2012

Specifically, I have a demo of a flash game (sort of super mario style). In it I have two types of weapon - a simple fire and big fireball. I reviewed the code in order to learn flash better [I am very new - since around monday this week].

I saw that the program has a variable that keeps track of the number of uses I have left in each weapon. I tried to review all the places this variable was used but I couldn't find where it affects the drawing onto the screen.

I even tried removing the variable declaration and then testing it - so I may find all references to the variable -- By the way any convinient way of finding all references to a variable/method/class [I am using ADOBE FLASH CS5.5]?
Also, I tried changing the variables starting value to "12" and I noticed that when I test the game, the weapon has 12 uses indeed.

So my problem:1. It seems that this variable is somehow affecting the drawing. Yet, I don't know how it does so since all the code I have found that uses this variable has nothing to do with drawing. It is all, logic, like

if(var <= 0){
var--;
} else{
return false;
}

Where is this influence coming from?get all references to a variable[like in eclipse ctrl+shift+g]?

View 1 Replies

ActionScript 3.0 :: Understanding System.totalMemory?

Mar 17, 2007

For a long time I've been puzzled by the new System.totalMemory variable. Whenever I make an AS3 project, I try using the following code:

Code:
package whatever {
import flash.system.System;

[code].....

View 2 Replies

ActionScript 2.0 :: Missing Key Understanding About Arrays

Dec 19, 2009

I've been using arrays and for loops in flash for some time now. Mostly successfully.But I'm missing some important understanding of how they really work. Here's the simple code that turns my head around and makes me realize I know nothing.[code]When I trace _root.term_array later in the code, it gives me the list of words and then a ton of 'undefined's. When I trace _root.term_array.length it says it's got 130 items. In my mind it should only have 13.

View 3 Replies

ActionScript 2.0 :: Understanding The Currentframe Concept

May 19, 2005

so I'm still learning the basic concepts. Attached to a movieclip used as a button I have this actionscript:

[Code]...

Which basically causes the movieclips 'leaf1' to shrink, 'vinefade' to go to its first frame, 'artween_mc' to unload, and for all other commands on this button to be disabled. I also want it to check another movieclip called 'leaf9', and see if it's current frame is at less than a particular frame number (73), because if so I want it to start playing forward. Once it reaches this frame number (73), I want to cause linkstween_mc to become visible and hit9button (also a movieclip) to become enabled. My current script does absolutely nothing to leaf9

View 6 Replies

ActionScript 3.0 :: Understanding Basics Of Random Motion

Apr 15, 2011

I started out learning AS3 on my own a while ago without any programming experience whatsoever. I'm still in my diapers, but slowly progressing. Currently I'm working on a short animation with some code involved. Part of the animation is a herd of cows grazing in a pasture. I have a class called Cow which extends MovieClip and on the Cow timeline I have the walk cycle and other cow movements animated. When a cow is walking it slowly moves horizontally, along the x axis. I want the cows, when walking to also randomly move up and down (along the y axis) which would basically look as though the cow is moving further away or moving closer towards us. I'll be resizing each cow, according to its y position to create the effect of perspective (near and far).

What I'm trying to figure out is how to make the cow move either up or down the y axis in a somewhat random way. By "somewhat random" I mean that I don't want the cow to switch directions every second, but rather something like: 5 seconds moving up the y axis, then maybe 8 seconds moving down, then possibly 4 up, then 11 down, etc. It would be super if I could also have a velocity factor involved, meaning that when changing directions - from up to down, or down to up - I prefer that the change is smooth, like as in a ease out and then ease in.

[Code]...

View 2 Replies

ActionScript 3.0 :: Understanding Script For Rotating Objects

Aug 13, 2009

I am trying to understand what part of AS3 script says loop through(create a continues 360 loop of objects) the images from an XML file, does this make any sense.[code]is this the part that says loop the images/objects.this is a little more to the script including the above to maybe understand better?[code]

View 40 Replies

ActionScript 3.0 :: Understanding A Basic Scripting Concept

Jan 16, 2010

I'm currently reading the book Learning ActionScript 3.0 and have dificulties understanding some programing basics due to my total lack of prior programing knowledge.For example now I'm looking at this script from the book that traces a list of all display objects on the stage and their children:[code]I understand everything except one thing. When there is an object with children (DisplayObjectContainer), the function traces the object but doesn't proceed and calls itself starting all over again this time analyzing the first child of the object. And if the child also have children itself the list will branch out until there is an object without children.What I don't understand is how the function at this point knows how to return to the last parent object and continue to analyzes its other children if any.For example when the function analyzes the stage of a scene with the following content how does the function know to continue analyzing child0. To me, looking at the code, I would expect the function to exit after listing [object StaticText]. I have hard time understanding what makes the function go back to largeContainer and continues with its child0 and so on.[code]This all what the book says regarding this which is not enough for me to understand this process:the function calls itself again. passing in the object currentlybeing inspected. This concept is called recursion. A function calling itself mayseem redundant, but it can be very useful. In this case, each time the functionis called, it receives a new display object to analyze, so the function reportsthe contents of that specific display object. The result is a complete walkthroughof all display objects, no matter how many children each may have.

View 5 Replies

Flex :: Understanding Remote Shared Objects?

Oct 20, 2009

I have 2 questions about remote shared objects in Flex/ActionScript3:1) If I connect to a remote shared objects, but do not handle the SYNC event, will the shared object still receive data from the server? ie. will the server still broadcast data to this client ? This is what I expect

View 2 Replies

Flex4 - Understanding Flash Packages And Dependencies

Sep 13, 2010

I'm trying to understand how packages and dependencies work with Adobe Flash Builder 4. I've copied an example here and put it in a .as file called DependencyGraph. However I get the error message:
A file found in a source-path must have the same package structure '',
as the definition's package, 'DependencyGraph'.
I understand that the original file has a package name called package flare.apps. What should I change to enable this to run?

View 1 Replies

ActionScript 3.0 :: Understanding Transfer Matrix Operations

Nov 14, 2010

I'm editing the MotionPath LinePath2D by Greensock to make it become LinePath3D. However I'm stuck in editing this method:

[Code]....

I don't get the operations Greensock does to find the y and x inside the atan2. Why does he multiply xChange (which is a scalar and it should be the delta-x of the Line segment [IMG]) to the b component of the matrix and then sum it to the other thing?

[Code]....

View 0 Replies

ActionScript 2.0 :: Modifying/Understanding Flash Counter?

Jul 2, 2008

fix a counter on one of the flash applets he hired someone to make for him. It's AS2 and done in Flash 8.

http:[url]....

It pulls from the current time on the system clock.Essentially it's counting 4 times too slow. I am awful with even reading AS let alone trying to find the equation running this. what I need to edit in the AS to speed this up?

View 12 Replies

ActionScript 3.0 :: Understanding The Load / Unload Event

Jul 20, 2009

My problem is understanding the load/unload event. What I have at the moment is a test file. There is one button that loads an external swf (carnival.swf). This seems to work ok as far as i can tell, although I think the way I have hidden the button once the SWF loads is wrong....anyway... On the carnival.swf there would be a "back to main page" button that would simply remove the carnival.swf from the stage and reactivate the button on the main swf, which in the future would have other buttons that would load other swf's on to the stage.

View 2 Replies

ActionScript 3.0 :: Understanding Doc Class And Adding Functions Via External .as File?

Sep 9, 2010

Say I have 3 fla files, each with it's own document class. I want to define some unique variables in each of those 3 files.Now once the variables (unique to each fla) are set, I want to call the same function - setting up the files. I want this function in a separate as file so i only have to make changes in one spot.How do I link the 1 .as file to each of the 3 doc class files and have it's function called in the constructor of each on

View 2 Replies

Understanding Flash SWC's Imported Into Flex Builder 3 And Key Framed Animation

Mar 25, 2010

I am trying to understand what is going on in a SWC that I am importing from Flash CS4 into Flex Builder 3. Specifically I am using a SWC supplied by a Designer as the animation for a custom preloader (a subclassed DownloadProgressBar).The issue I am trying to understand is, once the FlexEvent.INIT_COMPLETE is fired, I cleanup by removing the swc by running this [code]though even after I have removed this (which is successful, as I have checked by comparing this.numChildren before and after the call) the key framed animation still continues to run (not visibly). This has been detected by the Designer placing a trace in the time line of the animation (in Flash). Can anyone tell me why is it, that even after I have removed the animation from the subclassed DownloadProgressBar, it still keeps running ? Also, is it standard practice when importing SWCs to manage the cleanup of resources from the Flash side of things (much like releasing memory in obj-c). I find it counter intuitive that removing the child from the Flex side does not stop the animation.

View 1 Replies

Actionscript 3 :: Not Understanding Basics Of Dynamic DataBinding (bindPropety) In Flex

Jun 6, 2010

I need to dynamically bind properties of components created at runtime. In this particular case please assume I need to use bindProperty. I don't quite understand why the following simplistic test is failing (see code). When I click the button, the label text does not change. I realize that there are simpler ways to go about this particular example using traditional non-dynamic binding, but I need to understand it in terms of using bindProperty.

[Code]...

View 2 Replies

Javascript :: Reference The Html Object That Made The Call To SomeFunction Directly Using The ExternalInterface.call Call?

Jun 28, 2011

i have some actionscript that makes a

ExternalInterface.call('someFunction');

call.is it possible to reference the html object that made the call to someFunction directly using the ExternalInterface.call call?

Assume that the object that makes the call also has some Callbacks (via ExternalInterface.addCallback) that are accessible via javascript.

Currently:

Actionscript source
ExternalInterface.call("someFunction");
ExternalInterface.addCallback("someCallback",someASfunction);

[code]....

View 1 Replies

Understanding The "Instantiation" Of Actionscript/Flash Objects?

Jul 28, 2009

clarify the different logical instantiations of objects in actionscript?So far it seems there are 3 layers of instantiations, for lack of a better term.The first one is declaring a variable/type.Next is instantiating that variable with something solid in the code, like a method or function? Is this just a way to glue things together? Then after that you instantiate it on the stage, is this something you have to do explicitly, or is it a side effect? Is this "3 layer" concept the correct way of looking at it, kind of like the MVC for flash app logic?

View 2 Replies

Flash :: Not Understanding A "term Is Undefined" Error

Jul 24, 2011

Here is an example of the code I'm working on:

[Code]...

Note that I do have auto declare enabled in my script settings. How should I fix this?

View 1 Replies

ActionScript 3.0 :: Use ExternalInterface.Call To Call A JavaScript Function To Launch A Lightbox Window?

Jun 22, 2009

I'm trying to use ExternalInterface.Call to call a JavaScript function to launch a lightbox window. So far I have this:

AS3:
flash.external.ExternalInterface.call("launchLB", "" + aUrl + "");
JavaScript:
function launchLB(url) {
alert(url);

[Code]....

I get the alert but I can't get the lightbox window to display. When my as code makes the ExternalInterface call I get what looks like a page refresh and a blank browser window.

View 1 Replies

Actionscript 3.0 :: Remoting Call Throws Code=NetConnection.Call.BadVersion Error

Sep 27, 2009

I'm trying to get the AS3 Flash remoting example found here: [URL]. and I keep getting this error: Code: Select allError #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion at amfphp1_fla::MainTimeline/frame1() Here's the code I'm trying:

[Code]....

View 1 Replies

Actionscript 3 :: Simulating A Click Call To A Button(displayObject) Thats Generated Via An API Call?

Nov 2, 2011

I'm having trouble simulating a click call to a button(displayObject) thats generated via an API call( youtube as3 API). I have not seen any mention of security reasons as to why I can not simulate a click as long as something is registered with a click handler. Basically I checked to make sure the button made is listening to a mouse click event with:

trace(generatedButton.hasEventListener(MouseEvent.CLICK)) which returns true

I proceed to than call this:

generatedButton.dispatchEvent( new MouseEvent(MouseEvent.CLICK, true) );

And nothing happens yet if I physically click the button it works. Is there some security measure that prevents something from being fake clicked unless its origin is strictly from the system mouse?

I even set a timeout call on the click function and moved my cursor over the button and let it fire in case it was an issue of the mouse having to over the object but still nothing. I am kind of stumped at this point.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved