actionscript-3

TLFTextField text property not accessible in constructor

爷,独闯天下 提交于 2019-12-13 07:14:54
问题 I've placed TLFTextField in a MovieClip with some default text, MovieClip is assigned a class, In the constructor, trace(first_name, first_name.text); //textField is available but not the default text however default text is available inside another function a bit later, I need the default text to be available inside constructor to do some validations stuff (like for instance if field is empty, get the default text back on focus out event) 回答1: got it, TLFTextFields are only available once

1120: Access of undefined property shuffledArray

不羁的心 提交于 2019-12-13 07:05:21
问题 Please can you help me out I am new to as3 and I am trying to create a shuffled deck using the Fisher-Yates Algorithm. When I run the code with ctrl-enter it compiles with no errors but when I try to output it with trace(); it comes back with: Scene 1, Layer 'actions', Frame 1, Line 6 1120: Access of undefined property shuffledArray. Like I said I am new to this and it will be me doing something very stupid but all the same i'm stuck. Here is the code package src.CardDeck { public class

AS3 Smooth Jumping

一曲冷凌霜 提交于 2019-12-13 06:56:31
问题 I would like to know how to make a smooth jump in my game. Its a 2D game and the code is really simple but I would want to know how to make it better for it to slow down when it gets to the max height and then smooth drop. This is all I have for jumping: Player.y -= 50; 回答1: Your best bet would be to use a physics engine (Box2d etc). If you don't want the overhead of one though (if the only thing you'd use it for is jumping and not collisions) then you just need to add some friction to your

Force numeric keyboard on iOS using actionscript 3 (in CS flash 5.5)

亡梦爱人 提交于 2019-12-13 06:52:50
问题 I have a textInput box called systolicInput. To record the users blood pressure. When the user taps on the textInput the iOS virtual keyboard comes up. But it defaults to alphabetic input. How can I force it to display the numeric input keyboard? I am using ActionScript 3. PS: Thanks for reading this post, and any insight will be very much appreciated :) 回答1: Control of the keyboard type is possible in AIR 3 using the new StageText class. (You will have to manually update the AIR SDK to use

linking symbol to class actionscript

走远了吗. 提交于 2019-12-13 06:52:10
问题 There is a simple method of linking a symbol to a class in flash cs5 in the gui designer. But how can i do the same thing in actionscript alone using code because iam not using flash cs5. Iam using notepad++ and flex compiler. 回答1: Hopefully this link will answer your question: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/MovieClip.html The essence is this: [Embed(source="logo.gif")] [Bindable] public var imgCls:Class; and what this does is tell the

AS3. How to set-up players for real-time game?

橙三吉。 提交于 2019-12-13 06:49:09
问题 I'm creating flash fighting game 1vs1. Here is Hero (local-player) and Enemy (remote-player). How I need to setup them correctly that after connection to arena they will be spawned successfully? I mean if player 1 connects to arena he should be declared as Hero (local-player) and for him player 2 should look like Enemy (remote-player). The same for player 2. He should be declared as Hero (local-player) and for him player 1 should look like Enemy (remote-player). Here are 2 character's

Why Flash call External interface not longer called in IE11?

徘徊边缘 提交于 2019-12-13 06:39:40
问题 I have this snippet: <object id="myMovie" name="myMovie" type="application/x-shockwave-flash" width="100%" height="100%" data="swf/myMovie.swf"> <param name="movie" value="swf/myMovie.swf" /> <param name="allowFullScreen" value="true" /> </object> and I use : myMovie.doAction("hello world"); Which works great in FF, Chrome, IE9,IE10 but not in... IE11 ! Nothing happens ! What is wrong with that syntax on IE11 ? 回答1: I have the same issue , upgrade flush plugin to recent version (13) . code

How do I manually trigger a buttons hover state in Flex?

岁酱吖の 提交于 2019-12-13 06:38:30
问题 I need to trigger the hover state of a Flex button programatically, so that it looks like the user is hovering over it. There is a flex page about "Manually dispatching events": http://livedocs.adobe.com/flex/3/html/help.html?content=events_07.html Which would work, but what I'd really like to do is change the style of the button without having to throw an event. How can I do this? Thanks! 回答1: Is there any reason this wouldn't work? button.setStyle('skin', button.getStyle('upSkin')); 回答2: In

What is the error :a conflict exists with inherited definition flash.display:DisplayObject.mouseX in namespace public?

一笑奈何 提交于 2019-12-13 06:33:15
问题 This appeared as I was trying to use a mouseEvent to move an object. I placed the variables for mouseX and mouseY in the public class. I did the same for direction X and Y but there was no error message for those. 回答1: If the class you are adding the mouseX to is extending the DisplayObject type (and if it's any kind of Flex component than it does), you already have a variable with that name from that type. As a fix name your variable something else eg. myMouseX . If you don't know what

How to make MXML Component Constructor with Arguments? [closed]

不羁岁月 提交于 2019-12-13 06:32:07
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I`m new in flex and could anyone help me? How do I create a constructor that takes arguments for an MXML component? 回答1: You can't; MXML Components do not have constructors that you can modify. You have a few