actionscript

Java servlets and receiving XML from Flash's xml.sendAndLoad() function

All, I'm working on a Flash application that's supposed to send XML data to a Java Servlet. I'm responsible for the Flash app; another team is responsible for the Java Servlet. The problem we're having is that I'm familiar with Flash but not Java and Servlets; the other team is expert in Java and Servlets, but unfamiliar with Flash. ...

How can I encode reserved XML characters in actionscript?

I am writing a business app in Flex that uses web services to communicate with a middle tier. The web services accept and return messages in XML format. In many cases, I need to be able to allow the user to type something like the following into a field in the app, which in turn will be added as an element in an XML payload bound for a...

Difference between these two bit.ly API ActionScript implementations?

I'm new to Flex and wondering what the difference is between these two ActionScript implementations of the bit.ly API: http://github.com/julien/as3_bitly http://code.google.com/p/bitly-as3-api/ One thing I noticed is that one comes in .as files and the other's an .swc file. Is one better than the other for learning Flex? Thanks. ...

Actionscript converts xml content to htmlentities

Actionscript 2.0. I use this code to load some data. The data is some text with html tags within a CDATA section, and some other stuff. var xml_data:XML = new XML(); xml_data.ignoreWhite = true; xml_data.onLoad = function(success) { trace(this); }; xml_data.load("http://test/data.xml"); Why are all my html tags (and other special...

Testing and mocking with Flex

I am developing a "dumb" front-end, it's an AIR application that interacts with a "smart" LiveCycle server. There are currently about 20 request & response pairs for the application. For many reasons (testing, developing outside the corporate network, etc), we have several XML files of fake data, and if a certain configuration flag is se...

Drag and drop in dataGrid, custom cursor during drag not working (self answered, new question for the bounty)

EDIT 12/21/09, End of the day: I have managed to answer my own question so my bounty rep is lost to me :-( Anyway since my answer solves my problem I will award the bounty to anyone that can answer this. My solution uses AS to remove the the rollOut/rollOver while a user is dragging. In a dataGrid. How can you get the same result withou...

How can I do python/ruby/javascript style generators in actionscript?

I want to use coroutines in actionscript to implement a state machine. I'd like to be able to do something like the following function stateMachine():void { sendBytes(0xFFFF); var receiveBytes:ByteArray = yield() sendBytes(receiveBytes); } stateMachine.send( Socket.read() ) like in this blog entry ...

Ability to click on axis (Axis Interactivity)

Hi, I need to have interactive axis where user can click on it and I can return the clicked data points. Please provide suggestions in this regard. Thanks in advance. ...

AS2: Does xml.sendAndLoad use POST or GET?

All, I'm trying to find out, unambiguously, what method (GET or POST) Flash/AS2 uses with XML.sendAndLoad. Here's what the help/docs (http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs%5FParts&file=00002340.html) say about the function Encodes the specified XML object into an XML d...

FlexBuilder 3 - ActionScript Only - AIR Application

Using an ActionScript only project for AIR dev in FlexBuilder 3. I've already gone through the setup of changing the .mxml to .as to generate the main working file. I've also used NativeWindow.stage to get access for addChild, etc. Is there something I'm missing? When I try to use any flex codebase, there are always 'VerifyErrors'. Also,...

Flash Dynamic text in embedded movie

Hi I have my movie in the main timeline and then have a smaller clip in which there is a dynamic text box. In that smaller movie I have some actionscript myVars = new LoadVars(); myVars.load("http://preview.domain.co.uk/inc/loadVars.php"); myVars.percentage myVars.onLoad = function() { text_box.text = this.percentage; }; but wh...

ActionScript3 sign-extension with indexed access to ByteArray

In the following code: var bytes:ByteArray = new ByteArray(); var i:int = -1; var j:int; bytes[0] = i; // bytes[0] = -1 == 0xff j = bytes[0]; // j == 255; The int j ends up with value 255, rather than -1. I can't seem to find a document defining how indexed access to a ByteArray is supposed to be sign extended - can I reliably...

ActionScript 3.0 : How to access a Shape's segments?

EDIT (for clarification): I have a vector image with a simple contour, an irregular closed polygon. I need to import it into Flash in a way that I can then programmatically access each of the segments that form the polygon. Importing the vector image into the library as a MovieClip wasn't good because all I get is a shape from which I ca...

Vector class in a Flex Library Project

i seem to be having some problems with the Vector class in actionscript 3 in a Flex Project or an ActionScript Project it is possible to do this var v:Vector.<String>; But when i do the same thing in a Flex Library Project (to create an SWC) then i get the following error on that line of code 1046: Type was not found or was not a com...

Applying a color gradient on a line using ActionScript 3 / Flash

Hi, I am trying to construct a line dynamically, with a start and end gradient. I want to avoid using a GradientBox, as the lines are dynamic. All I want to do is have the line start red, end blue. This code does not work though :( myLine = new Shape(); myLine.graphics.lineStyle(2); myLine.graphics.lineGradientStyle(GradientType.LINEAR...

Flex: Drag and drop, simple example

Hi, I want to implement drag&drop possibilities in my application. Here is my source code: I added images to the container, and now want to be able to move them from element PieceContainer to element board (defined in the another class). I tried to define mouse move handler as it was shown here: http://livedocs.adobe.com/flex/3/html/he...

My events are being dispatched but nothing is happening? Do they have scope?

I have a flex app under construction that makes use of a lot of . I have a main module that has child modules. Ugh, I know. in one of these sub-modules, i want to know if i click a button. The handler for that button-click resides "higher" up in the app. I added an eventlistener looking for the event that I dispatch down in the sub-modul...

VideoPlayer delay (actionscript 3)

I am experiencing a minor issue...I have a button which is supposed to start a local .flv and loop it. However, there seems to be a small delay between the actual click and the flv starting to play. Here's the applicable code, is there anything wrong/can I do anything about that delay? The flv is small in size, should that matter at all....

Flex swf file: how to inspect the method exposed?

In every language there are a lot of tool to inspect the interface exposed by the compiled file, then what is the best tool for Flex swf file? I am debugging my code but the invoke always failed, I am writing my callee like below in my mcml file: public function playVideo():void { svid.play(); return; } ...

Flex actionscript: how can I export my function to other SWF?

I want to export some of my functions to external so that other people can embed my SWF into their's and invoke the function, how can I achieve that? ...