actionscript-3

Unable to change the column width dynamically in flex datagrid

一笑奈何 提交于 2019-12-25 05:09:22
问题 It's very very frustrating. I am using a singleton class (popup, which means it doesn't forget the last used variables) which contains a datagrid. I am making various columns visible/invisible, setting the widths and headers in accordance to data received from a database call. Everything works fine except that when I put the breakpoints before and after the point where I change width of columns, I do not see the change in width of datagrid at all! Instead I see some values totally out of sync

AS3 getDefinitionByName - Error #1065: Variable {class name} is not defined

不打扰是莪最后的温柔 提交于 2019-12-25 05:07:40
问题 My issue is slightly more complicated than the title suggests. I work for a company that has in the region of 20 flash games. Our players also have avatars which they can customise and these avatars are used inside our games. We have a file, Avatar.swf which is loaded by our preloader and then passed into GameName.swf. I want to take this Avatar movieclip and create a factory class so we can have many instances of it inside our games. I can get an instance of the Avatar movieclip from the

Netstream video not playing on iPad

£可爱£侵袭症+ 提交于 2019-12-25 05:04:31
问题 I am building an iPad app using Flash CS6 to compile to AIR 3.3 on a PC. One of the app requirements is a video player which can be overlaid with other display element - primarily for subtitles. I am using Netstream to play MP4 video (have also tried FLVPlayer with same results). Everything works fine when compiled to run in the emulator, but the video doesn't play once installed on my test device - iPad 3. (I did a simple test a few months ago and got video playing correctly with audio, but

Error #1009: Cannot access a property or method of a null object reference. when using sqlite

ぐ巨炮叔叔 提交于 2019-12-25 05:00:13
问题 I'm using sqlite in flash but I get this error: Error #1009: Cannot access a property or method of a null object reference. I have debuged it and this says it is on line 86 and 100 : stat.text = "UPDATE contacts SET fname=@fname, lname=@lname, phone=@phone WHERE id=" + itemList.selectedItem.data.id; and stat.text = "DELETE FROM contacts WHERE id=" + itemList.selectedItem.data.id; whole code: import flash.filesystem.File; import flash.data.SQLConnection; import flash.data.SQLStatement; import

AS3 quiz and answers

别等时光非礼了梦想. 提交于 2019-12-25 04:56:22
问题 Here's my problem; I want to make a quiz that at the end shows a person the qualities he/she has for chosing a specific college course. The quiz will ask 10 questions which each have 2 answers, upon clicking an answer, points will be earned for a specific course. For example the question could be 'Do you want to work with computers, or with people?' Upon answering Computers points will be gained at the courses Informatica, Designing and Editing Upon answering People points will be gained at

How to change the volume of a Sound using keyboard input?

﹥>﹥吖頭↗ 提交于 2019-12-25 04:55:29
问题 How can I increase/decrease the volume of a Sound on key-press in ActionScript 3.0 回答1: private var sound:Sound; private var channel:SoundChannel; private const INCREMENT:Number = 0.2;//change it as you like sound = new Sound(); sound.addEventListener(Event.COMPLETE, onLoad); sound.load(new URLRequest("song.mp3")); function onLoad(e:Event):void { channel = sound.play(); if(stage) { stage.addEventListener(KeyboardEvent.KEY_UP, onKey); } else trace("call this from a display object on stage"); }

Modules and Panels issue

只谈情不闲聊 提交于 2019-12-25 04:55:26
问题 I have the following problem. In my application I have several modules and each of them have components CollapsableTitleWindow (extends Panel). After opening the window it is added to the container which is in the main application (CollapsableTitleWindowContainer). In these windows you can open another window (and so on). Now, what is the problem. When I change (reload) any module and I want to open a new window (sub window) with the already loaded window I get this error: TypeError: Error

AS3 Display list and box2d

一笑奈何 提交于 2019-12-25 04:48:10
问题 I have a function called "brick" inside a subclass called createBrick that extends from the sprite class, also I have a movie clip created in the library exported for runtime sharing called "Brick". For some odd reason when I run the code the brick is not showing up on the stage even though it does get created when I debug the code. here is the function public class createBrick extends Sprite { public function createBrick(_main:Main) { main = _main; var go:Brick = new Brick(); addChild(go);

How to play music tracks in AS3?

故事扮演 提交于 2019-12-25 04:47:05
问题 I need to play three musical tracks one after the other in a circle. It is necessary that its are not loaded again and were in the cache. I use this code. Everything works fine on localhost, but only works after restart the app on the server. And wrong to re-download tracks every time. public function musicOn():void{ if (sndStart == 'true'){ req = new URLRequest("media/" + track + ".mp3"); snd.load(req); channel = snd.play(); channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);

AS3Crypto RSA Signing

爱⌒轻易说出口 提交于 2019-12-25 04:39:28
问题 I'm having some troubles matching the value returned from RSA signing a Base64 SHA1 hash in the actionscript as3crypto library with the result returned in c#. I'm passing in a Base64 hash decoded as a byte array to the sign() function provided in as3crypto and base64 encoding the result. However, this result never matches the returned result from a c# function which performs the same task. Does it matter that the function takes in and returns hex even though it works at the byte array level?