actionscript-3

Problem resizing loader after loading swf

放肆的年华 提交于 2020-01-05 08:09:30
问题 I'm using the following code to load an swf in a pure actionscript project (Flex Builder 3) _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, Loader_Complete); _loader.contentLoaderInfo.addEventListener(Event.INIT, Loader_Init); var request:URLRequest = new URLRequest("Skins/TestSkin.swf"); _loader.load(request); this.addChild(_loader); This works okay and displays the swf on the stage (500x375 for some reason - not sure why, TestSkin.swf is a flex app with no

Having trouble moving a character in AS3

为君一笑 提交于 2020-01-05 07:38:37
问题 So I'm a little new to Actionscript 3 and if I'm missing something crucial to solving just tell me and I will post it, but anyways... So I have 2 layers. The top layer is content and the bottom layer is as3 (for actionscript). In my content I have a little blue ball that is approx. in the center of the stage. And in my as3 layer I have the following code: //Add the event listeners... stage.addEventListener(Event.ENTER_FRAME, moveBall); stage.addEventListener(KeyboardEvent.KEY_DOWN, keypress);

convert from base 60 to base 10

时光怂恿深爱的人放手 提交于 2020-01-05 07:08:58
问题 I have a method that converts an int to a base60 string (using 0-9, a-z, and A-Z chars), but can't work out how to convert it back again. Here is my method for converting base10 to base60: public static function toBase60(value:Number):String { var targetBase:uint = 60; value = value.toString().split('.')[0]; var digits:Array = new Array(); while (value > 0) { digits.push(baseChars[value % targetBase]); value = Math.floor(value / targetBase); } var myResult:String = digits.reverse().join('');

Flex 3 DataGridColumn HeaderText Localization

拜拜、爱过 提交于 2020-01-05 06:17:12
问题 I'm working in a multi-language application using ResourceBundle in Flex 3. I'm displaying data in a DataGrid and defined DataGridColumn headerText like this headerText="{localizedHeaderText('LABEL_USER_NAME')} this function returns the localized label for the username, but when I dynamcally select another language evertying gets refreshed but the headerText labels? Any thoughts? Thanks 回答1: Unless you make the localizedHeaderText method bindable, the binding will never be re-evaluated since

how to implement a data-structure in flex that just like LinkedHashSet in Java

拟墨画扇 提交于 2020-01-05 05:53:32
问题 As ArrayCollection in Flex is limited, I'm looking for a data-structure that something like LinkedHashSet in Java, LinkedHashSet maintains a doubly-linked list running through all of its entries,it defines the iteration ordering, which is the order in which elements were inserted into the set (insertion-order).But there is little information about Flex data-structure, so anyone can help me, thanks 回答1: This library might be worth checking: http://sibirjak.com/blog/index.php/collections

how can i change texts in the dynamic textFields in SimpleButton instance (button symbol)?

自闭症网瘾萝莉.ら 提交于 2020-01-05 05:35:08
问题 this may be a basic thing, but i couldn't find an answer by serching internet. I have created a simple button - Istance name = "btnsample" and there are two layers layer 0- button design with rollovers - layer 1- dynamic text field - instance name = "txtbtnlabel" btnsample.txtbtnlabel.text = "new button label; but it's giving followin error :-119:Access of possible undefined propety txtbtnlabel through a reference with static type flash.display:simpleButton. how to solve this problem? 回答1: I

method (function) in subClass not being called on mouse event

半腔热情 提交于 2020-01-05 05:33:24
问题 My goal is: define a subClass of Sprite called Ship use an event at runtime to call a function within this new class It seems that I've figured out how to create my Ship class using a package in a linked .as file. But I can't seem to access the function within that class. Can anyone see what I'm doing wrong? var ShipMc:Ship = new Ship(); addChild(ShipMc);// This successfully adds an instance, so I know the class is working. addEventListener(MouseEvent.CLICK, ShipMc.addShip);//But this doesn't

Game assets not loading in Kongregate

我们两清 提交于 2020-01-05 05:26:18
问题 I just created my first game, and am having some problems. I uploaded to Kongregate(but didn't publish yet), and in the preview the external files(music and three pictures) don't load. The rest of the game works fine. If I try to change it so there is a zip with the assets in it and change the directory in the code, it falls apart. I'm using FlashDevelop, so everything is programatic. I noticed the swf is only a few kb large, so is there anyway to compile the assets into the swf file and load

How to push instantiated MC into Array dynamically?

时光怂恿深爱的人放手 提交于 2020-01-05 05:09:08
问题 Im really stuck. I have 5 MC´s that are being spliced from one array at a certain time. In that same function I want to push another movieclips into another array. The two arrays holds mc's that represent right or wrong answers. So when one question is being given a correct answer that questions visualisation alters. This function holds a incrementing variable as I do want the mc's to be pushed by the user and one at the time. The thing is I cant seem to refer them properly. I´ve tried

How to push instantiated MC into Array dynamically?

你。 提交于 2020-01-05 05:09:07
问题 Im really stuck. I have 5 MC´s that are being spliced from one array at a certain time. In that same function I want to push another movieclips into another array. The two arrays holds mc's that represent right or wrong answers. So when one question is being given a correct answer that questions visualisation alters. This function holds a incrementing variable as I do want the mc's to be pushed by the user and one at the time. The thing is I cant seem to refer them properly. I´ve tried