actionscript-3

How to access dynamic text field on stage from within the document class

末鹿安然 提交于 2020-01-07 05:24:09
问题 I'm trying to access a text input that I've already placed on the stage (inside a movie clip) but with no luck. I've defined an instance name for this dynamic text field which is currentUserCount I've got something like this set up in the document class actionscript file: package { import flash.events.Event; import flash.net.URLLoader; import flash.net.URLRequest; import flash.display.Sprite; import flash.display.DisplayObject; import flash.display.MovieClip; import flash.display.Stage;

Passing Data from PHP to Flash

早过忘川 提交于 2020-01-07 05:11:48
问题 I am trying to get some basic data passed from PHP to Flash. From reading on the topic I understand the best way is to create XML with PHP then read it in Flash. I am trying to start out simple so here is my PHP code: <?php header('Content-Type: text/xml'); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; echo "<userData>"; echo "<firstName>John</firstName>"; echo "<lastName>Smith</lastName>"; echo "</userData>"; ?> And here is my Flash code: var xml:XML = new XML(); var url:URLRequest =

Compile actionscript using mxmlc compiler

天涯浪子 提交于 2020-01-07 05:05:47
问题 How would you compile actionscript code whose main class is inside a package using mxmlc command line compiler? Consider the following - com.nuaavee::MainClass com.nuaavee.utility::SomeUtility MainClass imports SomeUtility class. Is there a way to compile these classes keeping MainClass as the main class to generate a swf? 回答1: Here is a solution that has been tested to work - mxmlc -output main.swf src/com/nuaavee/MainClass.as -source-path src/ 回答2: If it's just a Utility class, it should be

Compile actionscript using mxmlc compiler

吃可爱长大的小学妹 提交于 2020-01-07 05:05:11
问题 How would you compile actionscript code whose main class is inside a package using mxmlc command line compiler? Consider the following - com.nuaavee::MainClass com.nuaavee.utility::SomeUtility MainClass imports SomeUtility class. Is there a way to compile these classes keeping MainClass as the main class to generate a swf? 回答1: Here is a solution that has been tested to work - mxmlc -output main.swf src/com/nuaavee/MainClass.as -source-path src/ 回答2: If it's just a Utility class, it should be

flash-as3 code execution order: accessing a flash pro instance after gotoAndStop()

大憨熊 提交于 2020-01-07 05:01:08
问题 this is a follow up question to this question i have never actually got the flash-actionscript code execution order. in flash pro i have an instance of a moveiclip on stage in frame one named tree1 and on frame 3 i have on the stage tree3 . in the document class i have this code: stop(); var scaleFactor:Number = tree1.scaleX; gotoAndStop(3); tree3.scaleX = scaleFactor; while this works when testing on the desktop, this app will go mobile at the end is this the correct way to go or should i

ActionScript 3: maintaining textarea UIscrollbar position on loss of focus in flash embed

这一生的挚爱 提交于 2020-01-07 04:38:38
问题 I'm using Flash CS4. Everything functions as it should when CS4 previews the swf after compiling it. However, after embedding the flash item in a webpage, if the textArea loses focus within the flash piece, the textarea's built-in UIscrollbar resets to the very top. Here's the kicker: if I add a FOCUS_OUT event listener to the textArea to store the current scrollbar value, I find that the scrollbar value has been reset to minimum even before the FOCUS_OUT event is triggered! WTF? I think this

I need to help about “ Action Script 3 , public Function with Button ”

守給你的承諾、 提交于 2020-01-07 04:33:25
问题 Public function PencereyiGizle ( btn:Button ) { .... .... } I have a problem with the btn:Button 1046: Type was not found or was not a compile-time constant:Button.. package { import flash.display.MovieClip; import flash.display.NativeWindow; import flash.display.NativeWindowInitOptions; import flash.events.Event; import flash.events.MouseEvent; import flash.display.SimpleButton; public class PencereyiGizle extends MovieClip { public var natWindow:NativeWindow=new NativeWindow( new

I need to help about “ Action Script 3 , public Function with Button ”

北城余情 提交于 2020-01-07 04:33:04
问题 Public function PencereyiGizle ( btn:Button ) { .... .... } I have a problem with the btn:Button 1046: Type was not found or was not a compile-time constant:Button.. package { import flash.display.MovieClip; import flash.display.NativeWindow; import flash.display.NativeWindowInitOptions; import flash.events.Event; import flash.events.MouseEvent; import flash.display.SimpleButton; public class PencereyiGizle extends MovieClip { public var natWindow:NativeWindow=new NativeWindow( new

How to align the actionscript project?

☆樱花仙子☆ 提交于 2020-01-07 04:23:06
问题 I have a pure code Actionscript 3 project in flash builder 4 and I want to align the stage. For now I have a sprite that I have set the x property to 10, but the sprites are in the middle of the screen. How to set these kind of properties in code? I suppose it's the stage object that needs to be set in some way. 回答1: You should have a look at the Stage.align property. For example, if you want to align your Stage depending the top left corner : stage.align = StageAlign.TOP_LEFT; Make sure the

How to use two .as files in Flash using actionscript 3?

偶尔善良 提交于 2020-01-07 03:21:10
问题 I can only specify a single .as file,how can I have 2 classes in it? 回答1: The file (In your case, its MinPlay) you specify is called the document class. Among the contents in the file, the file is supposed to have class a class named 'MinPlay' which extends either a Sprite or Movieclip. Something like package { public class MinPlay extends Sprite { // Constructor?? } } So basically when you type in the document class as above, the constructor will be called. It is totally up to you to