actionscript-3

Accessing Movieclips in movieclips

你说的曾经没有我的故事 提交于 2020-01-25 06:47:02
问题 I am starting with AS3 programming icm with Flash Builder 4. I have created a "Main" class which is the initial stage. On this stage there is a movieclip called mcMain. In this mcMain is 4 other movieclips: mcStats1 mcStats2 mcStats3 mcStats4 How can I access these mcStats1-4 from the code to make them go to another frame? I tried: var t:MovieClip = MovieClip(getChildByName("mcMain")); t.getChildByName("mcStats1").gotoAndPlay(3); But that just keeps giving me null reference errors: TypeError:

Accessing Movieclips in movieclips

天涯浪子 提交于 2020-01-25 06:46:06
问题 I am starting with AS3 programming icm with Flash Builder 4. I have created a "Main" class which is the initial stage. On this stage there is a movieclip called mcMain. In this mcMain is 4 other movieclips: mcStats1 mcStats2 mcStats3 mcStats4 How can I access these mcStats1-4 from the code to make them go to another frame? I tried: var t:MovieClip = MovieClip(getChildByName("mcMain")); t.getChildByName("mcStats1").gotoAndPlay(3); But that just keeps giving me null reference errors: TypeError:

How do I call a button instance in an external .as script?

别说谁变了你拦得住时间么 提交于 2020-01-25 03:33:24
问题 I've created a button in my stage. I've set the instance name to init and have the MainTimeline being called from an an external script: ./Project/MyFlash.fla ./Project/MyFlash_fla/MainTimeline.as I'm a beginner in Flash attempting to create a button and call it inside MainTimeline.as ; the error returned: ReferenceError: Error #1065: Variable init is not defined. at tfm::MainTimeline() I've also tried var init:Button = new Button(); with no luck. More specifically, I am trying to do this:

How do I call a button instance in an external .as script?

跟風遠走 提交于 2020-01-25 03:33:23
问题 I've created a button in my stage. I've set the instance name to init and have the MainTimeline being called from an an external script: ./Project/MyFlash.fla ./Project/MyFlash_fla/MainTimeline.as I'm a beginner in Flash attempting to create a button and call it inside MainTimeline.as ; the error returned: ReferenceError: Error #1065: Variable init is not defined. at tfm::MainTimeline() I've also tried var init:Button = new Button(); with no luck. More specifically, I am trying to do this:

Flash game simple performance tricks

跟風遠走 提交于 2020-01-25 03:02:07
问题 I'm trying to make some simple flash games but before I start purring mega bytes of data into the game it's better to seek wisdom from pro coders since I;m totally new to AS3. 1st Question is: what's the best way to load the game faster? since bandwidth is limited like hell for me and loading a flash game takes some time I'm trying to make the game start as fast as possible and load the rest of materials in the gaming process.I saw this on lots of facebook games. 2nd: how to keep the RAM

Flex 4 - How to set errorTip in FormItem?

99封情书 提交于 2020-01-24 15:30:06
问题 I am the new one for flex 4. In my sample application, I am using validator. It display's the error message and icon at beside's of the control. My question is, How to remove these error message and error icon? And I want to display my error message as a errorTip when the mouse is over the particular control. Thank you. Edit My sample code. I am using this with some other controls <fx:Declarations> <mx:StringValidator id="nameValidator" source="{employeeName}" property="text" tooLongError=

How to calculate the time-length of a midi-file

梦想的初衷 提交于 2020-01-24 11:19:15
问题 I am reading midi files in as3 (flash cs5) with the help of the helpful library that is called midas ( http://code.google.com/p/midas3/) - the midi-as3 library. I am trying to figure out a simple way to calculate the whole duration of the midi file (for example - total time of 4 minutes or 6 minutes...). I assume I could calculate the last note of each track + check the tempo and figure it out, but I was wondering if: Is the duration of the midi file is written somewhere in the data that I

How to calculate the time-length of a midi-file

百般思念 提交于 2020-01-24 11:19:09
问题 I am reading midi files in as3 (flash cs5) with the help of the helpful library that is called midas ( http://code.google.com/p/midas3/) - the midi-as3 library. I am trying to figure out a simple way to calculate the whole duration of the midi file (for example - total time of 4 minutes or 6 minutes...). I assume I could calculate the last note of each track + check the tempo and figure it out, but I was wondering if: Is the duration of the midi file is written somewhere in the data that I

Loading external images from another domain

时间秒杀一切 提交于 2020-01-24 09:31:07
问题 Is it possible to load an image(jpg, png, gif) from another domain and manipulate the pixels? I guess when the image is downloaded/copied it is in my domain. Using the Loader and add the content to an Image component I get an error in my debugger. I guess there are some cross domain polices at work here. But I need to be more sure how this works before moving on. I guess, if it is not possible to load the image directly I could create a local proxy. Could someone please enlighten me? Thanks

How can I detect system Chinese, Korean, and English fonts without embedding one for each? (AIR mobile on Android and IOS)

不羁的心 提交于 2020-01-24 05:24:33
问题 My learning app requires displaying Korean, English and Chinese. One solution I have is to embed a Korean/English font and a Chinese font. Then put together a string with different TextFormat s. The thing is, I'm positive that IOS and Android devices should contain native Chinese, Korean and English fonts already, and I'd much rather refer to and use those fonts instead of packing them. I tried detecting fonts by using Font.enumerateFonts(true) , but when I use font.hasGlyphs('你') , I don't