actionscript

accessing root from the class in Action Script 3

你。 提交于 2019-12-13 07:37:08
问题 It throws the following warning but works in spite of warning. TypeError: Error #1009: Cannot access a property or method of a null object reference. at play_fla::MainTimeline/play_fla::frame1() Here is the working code package { import flash.events.KeyboardEvent; import flash.events.MouseEvent; import flash.display.SimpleButton; import flash.display.*; import flash.text.*; import flash.events.Event; import flash.display.MovieClip; public class ClickButton extends SimpleButton { public var

Trying to add a skinClass to <mx:Form>

不羁的心 提交于 2019-12-13 06:47:26
问题 I'm working with Flex4 and I'm trying to skin a form (add a background and a border to it, etc.) I'm trying to do it the Flex 4 way with skinClass="" <mx:Form skinClass="skins.MyFormSkin" /> but it's not accepting skinClass as a property. How should I do it such that I'm still adhering to the best practices in Flex 4 (decoupling visuals from logic)? 回答1: skinClass only works on spark components, which have tags starting with <s: 回答2: To elaborate on Qz's response: mx:Form is not a Flex 4

Actionscript error #1009

二次信任 提交于 2019-12-13 06:41:40
问题 I have some nested movieclips in my banner and can't realize how to prevent error it gives me while running. There is a movieclip that runs 3 times and there is a nested movieclip that runs 3 times too, so the nested movieclip runs 9 times totally. When the nested movieclip runs 4th time, it gives me error, but everything works as it's needed - the main thing made in actionscript in the banner is changing text fields. I attach a source file, please have a look it this. I just don't know what

Embedding swf into flash builder— “Type was not found”?

心已入冬 提交于 2019-12-13 05:59:52
问题 I am developing mobile app in ActionScript. Im importing .swf file but get error: Type was not found or was not a compile-time constant: MySwf. Here is my code: package { import flash.display.Sprite; import flash.display.StageAlign; public class gyyyyppp extends Sprite { [Embed(source='assets/g1.swf')] public static const MySwf : Class; public function gyyyyppp() { stage.align = StageAlign.TOP_LEFT; var p3:MySwf= new MySwf(); addChild(p3); } } } What I am doing wrong? (p.s. my swf file is

Adobe Flash: Making an Interactive Charting UI Component “from scratch” (without Flex)

霸气de小男生 提交于 2019-12-13 05:40:04
问题 I'm looking for resources on making an interactive charting component in Adobe Flash without use of Flex (or, minimal use). That is, starting "from scratch" with Flash and ActionScript 3.0. Is there recommended reading? Perhaps a good recent book on the subject, or a detailed blog article, or an open source project to look at? I'm interested in the development process, and specific design patterns (for example, extending Sprite as the logical base class for your component). Thanks! ♥ 回答1: The

Flex : difference between using HTTPService and URLRequest

送分小仙女□ 提交于 2019-12-13 05:39:38
问题 What is the difference between using HTTPService and URLRequest for requesting your data from a flex page to servlet 回答1: URLRequest is the Request Object that contains the URL to load, the post parameters, etc. Usually it is used with more basic loader types than HTTPService, like URLLoader. HTTPService takes the URL directly as one of its properties, so it doesn't need a URLRequest. Technically, you could use a URLRequest to provide the rest of the "payload," since it is an Object and the

Program help needed in Actionscript 3 game

主宰稳场 提交于 2019-12-13 05:31:21
问题 I have been making this game in AS3 and the basics work. The thing i am having trouble with is making a 'start' menu appear when the game starts but also when the player dies. I have been trying the .visible code but that didn't seem to work. Question: What code do i add to my game that makes the start button appear when the game starts but also when the player dies. Code: package{ import flash.display.MovieClip; import flash.events.KeyboardEvent; import flash.ui.Keyboard; import flash.events

Flex: application is confused when passing variables to custom component

£可爱£侵袭症+ 提交于 2019-12-13 05:01:29
问题 I'm new to Flex and I'm missing something very basic about architecting a Flex application -- I've implemented a custom component MyReportGrid and extended GridColumn with MyColumn . I've tried to outline the application code below. The interesting thing to notice is that class OfficeItems is used by class MyItems , and the MyColumn (which extends GridColumn ) includes a customPath variable that is used to access variables pen , pencil , and stapler inside class OfficeItems . I believe that

Loading swf from a seperate file server

南楼画角 提交于 2019-12-13 04:44:53
问题 I am currently wondering if it is possible to load a swf that is sitting on another file server. I.e. I currently have a custom play bar swf which is embedded on a website (behind the company's firewall) which then loads swf content (currently in the same folder on the website server). The problem I have is bandwidth between remote sites is limited and streaming the swf content from the website server is not an option, however we do have a DFS set up to push all the swf content out to local

Garbage collection question (display list + actionscript)

旧时模样 提交于 2019-12-13 04:42:53
问题 If I add an object that extends a MovieClip or a Sprite to the stage, and I remove that object from the stage, do I need a destroy method if: There aren't any event listeners attached to that object I added display objects to that object? (obj.addChild(whatever) --> do I need to remove "whatever" when I remove object from the display list or is that redundant?) Any instance variables associated with that object - do I need to null those? 回答1: If you remove all references to a parent object,