actionscript-3

Accessing E4X nodes having special characters in name without breaking binding chain in flex.

I am using E4X to bind some values from xml in flex 3. There is a problem when xml tag's (or attribute's) name has special character in it: having xml content var xml:XML = <tag> <special-name att="val" /> </tag> special-name could not be accessed using xml.special-name.@att because it is interpreted as subtraction, on the other ...

images don't load on papervision3d planes

I have downloaded a code for creating carousel's in papervision. The code works fine, complete with mouse interaction and all that, except for the bitmaps to be displayed as the faces of the planes. http://paste.pocoo.org/show/202499/ is the source code. ...

Flash in firefox does not start unitl they show in page

I have this little problem. My client wanted two distinct swf on a web page: a viewer on top and a slideshow of images at bottom. Clicking a link on the slideshow make the viewer load a movie, by means of LocalConnection api. The slideshow has a default, so when the page is loaded a default movie start. This works nice on all browser....

How to catch a HTTP 404 in Flash

When I execute the (2nd) below code with a wrong url (number '1' added at the URL end), I get the below error. How can I catch this error, in case the url is wrong, so that I can give out an error message to the user ? Error opening URL 'http://localhost/myapp/cgi-bin/savePlanScale.ashx1?NoCache%5FRaumplaner=F7CF6A1E%2D7700%2D8E33%2D4...

Flash Media Server Server Side Action Script

I have two classes that inherit from NetConnection and both establish connections to two different FMS Applications. Class A connects to the vod application on FMS Class B connects to the BWCheck application on FMS BWCheck calls two callbacks on ClassB "onBWCheck" and "onBWDone" (these methods are members of Class B, but not Class A)...

Prevent overlapping DragDrop Images in Flex

I am trying to create basically a puzzle in Flex Builder 3. I display images from an array onto a canvas that can be dragged and dropped around the canvas. My problem is that I don't want the images to be able to overlap each other. Any ideas on how to prevent this?? They can overlap as you drag but not when dropped, they need to "snap...

Publish to Facebook Stream in as3

Hi, I am trying to publish to a users stream when they click a share button in my flash app that i have living in a tab on a fan fan. I basically have my swf embedded on a page that has a java script function that calls the facebook share dialogue. Here is what i got so far: // flash embedd <fb:fbjs-bridge/> // share function <sc...

how do I find the number of xml children in AS3

so live docs says this for calling .lenght() on an XML object For XML objects, this method always returns the integer 1. The length() method of the XMLList class returns a value of 1 for an XMLList object that contains only one value. i called it on an xml that looked like this: <xml> <picture>1</picture> <picture>2</pictu...

Extending Flash Project from a SWC

If I try to extend my main project file from a SWC , it shows the objects(movieClips) in the SWC as null. If I make a new class and extend that class from the SWC and create a object of that class in my main project. It works fine. Can't I extend my project from a SWC? ...

Determining an initial NetStream buffersize based on bandwidth and bitrate

I'm trying to determine an initial value for NetStream.bufferTime based on the client's calculated bandwidth and the video's bitrate. As far as I can tell you can't do this, because you must have an initial buffer set BEFORE you call NetStream.play() (or use the default 2 seconds) and FMS does not call NetStream.onMetaData, where one wo...

strings and textfields, AS3

How do I get my text fields to populate correctly and show single digits? Description Each textfield receives a substring. This doesn't limit it's input, because the text fields shows extra numbers. See illustration. Ex A //Tweening method 'could substitute code with Tweener' import fl.transitions.Tween; import fl.transitions.easing.*...

Face Recognition in AS3

Hey all, I have been working on a project which involves Marilena(project that ports Face Detection part of OPENCV to ActionScript3). Right now I can take the faces and keep them as byteArrays. I am working on Flash Builder 4. I want to add Face Recognition part either. I will identify the faces by connecting to a database but I couldn...

Can ActionScript tell when a SWF was published?

I'd like to write a little class that adds a Day/Month box showing the date a SWF was published from Flash. The company I work for regularly produces many, many SWFs and many versions of each, iterating over the course of months. A version-tracking system we've been using to communicate with our clients is a Day/Month date-box that give...

Dynamic Variable Names

I have a function that is called 3 times, I want times to assign it a name. How can I assign dynamic variable names to movieclips or do reference them by name or instancename? var loadedMovie:MovieClip = new MovieClip(); loadedMovie.name = "mymovie"; loadedMovie = loadEvent.currentTarget.content; loadedMovie.x = 0; loadedMovie.y = 0;...

Problem to display 3D google map.

hello friends, I have implemented one Flex application in which I want to display 3D google map.In which I am getting the error the NUll object reference during map display. Here is my code:- import com.google.maps.controls.MapTypeControl; import adobe.utils.XMLUI; import mx.rpc.events.FaultEvent; import mx.control...

ItemFocusIn Not Working on Non-Editable DataGrid in Flex

I realize that ItemFocusIn is somehow only applicable to editable datagrids in flex, nevertheless I want to fire an event anytime the user selects a new row in a non-editable datagrid. I have successfully used the CLICK event, but this event is not fired when the user uses the keyboard to select a different row in the datagrid. What do...

Actionscript-3 random numbers between max and min...

hi, I'm generating a random number between min and max with this code: return min + (max - min) * Math.random(); And it works. However, the random numbers are very little usually between "1 or 3" even if the max is 80. How can I better distribute the random numbers over all range ? thanks ...

Problem with ActionScript 3.0 button to URL and root movieclip

Okay, so, here's what the problem is. I'm creating a flash site with each page being it's own movieclip and Scene 1 being the menu and other things that stay on the site. I've created a MovieClip called 'HowWorksScene'. The movieclip has 2 buttons that link out to different URLs, however, I'm sure that when 1 of the button scripts wor...

FLEX, Actionscript: 2 questions about mouseOver event and image scaling

hi, 1) if I create items in a for loop, is correct to add a new eventListener for each item ? Or should I add only 1 eventListener to the parent ? and call the event through ID ? 2) if I want to scale my item, (a LinkButton with icon image), I noticed that the icon is sometimes resized with delay, so I have a bit of flickering when I t...

Which pattern is good for bullets hit test in game that need server validates ?

I would like to design a PvP game uses flash in client and java socket server, but I do need server validates trajectory and if bullets hit target from cheating. Is there any tutorial or paper provides how to do this ? ...