actionscript-3

Create a timeline from date to date in Flex/AS3

江枫思渺然 提交于 2019-12-25 04:39:10
问题 I need to create a timeline between 2 given dates, ie: 2006-01-20 - 2009-02-14 The timeline must be drawn on a given width (can be altered), ie: 600px But I need to add markers, one on year beginning, and others 4 times during the year (each 73 days aprox): Any tips? 回答1: I think the axes in the Flex Charting package allow you to do such formatting by default. If you need to do more, Flex Charts also allow you to draw of them. That might be what you're looking for. Link: http://livedocs.adobe

Restrict MouseEvents to Mask in Flex Skin?

偶尔善良 提交于 2019-12-25 04:37:15
问题 I have a ButtonSkin (Flex 4 Skin) with a Rect, a Label, and a Group, the Group masking the Rect. On rollOver, I animate the Label's x to this.width , and on rollOut, back to the original position. The problem is, when I rollOut, if I roll to the right (where the label is hiding behind the mask), it doesn't register rollOut, until I go past the label (this.width * 2). How do I prevent that, so when I rollOut of the visible area, even though I'm still over the label behind the mask, I get a

AS3 Procedural. Randomise order of Items in Combobox From XMl

ぃ、小莉子 提交于 2019-12-25 04:27:18
问题 I am attempting to read an XML file and add all the elements to a ComboBox in a random order (I have no idea how to do this). I have produced a ComboBox on stage called Primary_CB. I have my XML all set in the following format... <data> <elements> <element1> <primary>Male Character</primary> </element1> <element1> <primary>Female Character</primary> </element1> </elements> </data> My AS3 basically reads the XML file and populates the contents into the ComboBox like so... Primary_CB.prompt =

Pass a callback in ExternalInterface

為{幸葍}努か 提交于 2019-12-25 04:24:07
问题 I want to call a Javascript function from Flash, which I can do with ExternalInterface , but the Javascript function takes a callback. Is there a way to give it a Flash callback? I've thought of something like this: ExternalInterface.addCallback("foo", function(){...}); ExternalInterface.call("theFunction", "foo"); But that wouldn't work since theFunction would attempt to do foo() , while it should really do swfObject.foo() . The problem is the page and its Javascript are not under my control

MySQL,PhP, and Flash As3 Data is not loading properly?

纵然是瞬间 提交于 2019-12-25 04:22:54
问题 For some reason the PHP variables are loading very improperly. So this is what happens: In my PHP code I have: <?php include_once "connect.php"; $username = $_POST['username']; $password = $_POST['password']; if ($_POST['systemCall'] == "checkLogin") { $sql = "SELECT * FROM users WHERE username='$username' AND password='$password'"; $query = mysql_query($sql); $login_counter = mysql_num_rows($query); if ($login_counter > 0) { while ($data = mysql_fetch_array($query)) { $testing = $data[

access dynamically loaded movieclip (stage > scrollpane > myloader > movieclip)

独自空忆成欢 提交于 2019-12-25 04:17:59
问题 what I'm trying to do is accessing snapText = scrollPane.source.textSnapshot; from an external swf. I've tried: trace("-->: "+scrollPane.source.textSnapshot.getText(0, 1000)); trace("-->: "+myLoader.content.textSnapshot.getText(0, 1000)); trace("-->: "+mc.textSnapshot.getText(0, 1000)); trace("-->: "+mc.getChildAt(0).textSnapshot.getText(0, 1000)); trace("-->: "+mc.getChildByName(myLoader).textSnapshot.getText(0, 1000) ); trace("-->: "+scrollPane.content.textSnapshot.getText(0, 100)); all of

ProgressEvent.PROGRESS not firing in AS3

此生再无相见时 提交于 2019-12-25 04:17:22
问题 I trying to create a preloader for a game in Flash CS6. I've already slowed down the download speed to 1,2 kb but the ProgressEvent.PROGRESS is never fired. This is what I have: import flash.events.Event; import flash.events.ProgressEvent; stop(); loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressMade); function onProgressMade( progressEvent:ProgressEvent ):void { trace( loaderInfo.bytesLoaded, loaderInfo.bytesTotal ); } The stage stays blank but onProgressMade gets never called.

RegExp in ActionScript 3: How to exclude a complex prefix?

£可爱£侵袭症+ 提交于 2019-12-25 04:16:13
问题 AS3 RegExp engine (and ECMAScript based JavaScript) do not support complex "lookbehind" expressions. (lookahead expressions are fully supported.) For example: (?<=<body>)(.*?)(?=<\/body>) will work but; (?<=<body\b[^>]*>)(.*?)(?=<\/body>) will not work in AS3. What I need is to match a complex prefix but exclude it in the final match. In the example above; I'm trying to get the body contents in an HTML text but NOT the opening and closing body tags. And the actual test text looks like this:

Referencing a object that is on the stage inside a class?

最后都变了- 提交于 2019-12-25 04:15:07
问题 So I had the issue with ENTER FRAME so I moved it to a separate class and this is what the class looks like package { import flash.display.MovieClip; import flash.events.Event; import flash.accessibility.Accessibility; import flash.display.DisplayObject; import flash.display.Stage; public class enemy extends MovieClip { public function enemy() { // constructor code this.addEventListener(Event.ENTER_FRAME, moveEnemy); } public function moveEnemy(e:Event):void{ this.x += 5; if(stage.player

air 2.6 serversocket and actionscript 3 socket connection

房东的猫 提交于 2019-12-25 04:09:58
问题 I have written a server application in AIR 2.6. I use the ServerSocket class for the server side and the client side is written in actionscript 3 and uses the Socket class. When I connect the client to server with local IP (127.0.0.1 or 192.168.0.2), I get this message: <policy-file-request/> . I then send my policy file to client from server and connection is successfully. However, when i connect client to server with my global IP (IP assigned by my ISP), I get the same policy file request