actionscript-3

How to import a document class file into another flash file?

血红的双手。 提交于 2019-12-13 08:05:41
问题 I have 2 .fla files and one of them is associated with a class file called DocumentMain, it is a game. and what I want is when I click "stat" on the first .fla file it takes me to the game swf file. I did the myLoad function and it look like this : btnstart.addEventListener(MouseEvent.CLICK,gamecontent); function gamecontent(myevent:MouseEvent):void { var myLoader:Loader = new Loader (); var myURL:URLRequest = new URLRequest("game.swf"); myLoader.load(myURL); addChild(myLoader); } but I get

Stop the main timeline from within a Class function

白昼怎懂夜的黑 提交于 2019-12-13 07:43:27
问题 I need to stop the movie at the first frame using a function from a class, I know I can use stop(); or this.stop(); but how do I stop the main timeline from within a class function? package { public class myApplication { public function myApplication(stageRoot:Stage) { stop(); // this doesn't work this.stop(); // this doesn't work either } } } 回答1: You can access the main timeline from any display object (that is on the display list) by using the root keyword: MovieClip(root).stop(); If your

How to apply action to mulitple flash layers

ε祈祈猫儿з 提交于 2019-12-13 07:41:38
问题 I have 5 layers with symbols on each: a, b, c, d and e. I am trying to work out how to apply the action bellow to a, c, d and e when you hover over b. Also is there another action similar to ' gotoAndStop(0); ' that instead of going immediately to frame 0 it goes back the way it came? Link to .Fla http://www.fileden.com/files/2012/11/27/3370853/Untitled-2.fla stop(); stage.addEventListener(MouseEvent.MOUSE_OVER, playMovie); function playMovie(event) { play(); } stage.addEventListener

Adding to Stage in ActionScript 3 from a .as file

ぃ、小莉子 提交于 2019-12-13 07:36:11
问题 Note: Yes, I know that similar questions have been asked before. However, after following the answers in such questions I'm still stuck and can't find a solution to my problem. I'm having a problem which requires adding DisplayObjects to the Flash stage. Since I have to Display elements of several different classes, I decided to create a class to work as an intermediary between the .as files and the addChild function called "Displayer" as shown below: package { import flash.display

Detecting and using collision detection between two different arrays to remove instances of them

♀尐吖头ヾ 提交于 2019-12-13 07:30:19
问题 I'm currently creating a small flash game using ActionScript and after receiving help for another issue I had on here, I've encountered another one when moving onto a different part of it. This is the code I currently have: var asteroidSpeed = 5; var soundExplosion:Sound = new ExplosionSound(); stage.addEventListener(KeyboardEvent.KEY_DOWN, onKDown); var newLaser:Array = new Array(); function onKDown(e:KeyboardEvent):void { keys[e.keyCode] = true; if (e.keyCode == 32) { /*laser.x = player.x +

Remove Movie clip as3

纵饮孤独 提交于 2019-12-13 07:29:25
问题 Ok this has been driving me nuts for the past couple of hours and i know there is an easy answer. I have a scrollPane which has a movie clip called right_container_mc as it's source. Inside this right_container_mc I have other other movie clips called execiseBox that get added (in the correct positions on the stage) from an array with a for loop. Each exercise box has a button symbol called close_btn. Firstly I'm not sure that this is the best way to achieve this so feel free to suggest a

How would I create this AS3 data structure in objective c?

一曲冷凌霜 提交于 2019-12-13 07:25:51
问题 In AS3 if I wanted to quickly setup some data to work with, I would just do something like this... static var playerData:Object = {position:{startX:200, startY:200}}; How would I create the same in Objective c? Or..is there a better way to store a similar data structure in Obj-c? 回答1: To be clear, I'm not an expert in Objective-C, so maybe some Objective-C guru can help you better than I can. But I think that you can use NSMutableDictionary to simulate the Object AS3 behaviour: id playerData

hitTestObject with dynamically add movies

核能气质少年 提交于 2019-12-13 07:24:32
问题 I have code that adds a movie clip to the stage. The problem is, after it is added I want to add a hitTestObject on that object instance however I keep getting this error: TypeError: Error #1034: Type Coercion failed: cannot convert "ast_0" to flash.display.DisplayObject. at spaceranger_fla::MainTimeline/addAstroid() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() Here is my code: // Add astoid var astTimer:Timer = new Timer(5000); astTimer.addEventListener(TimerEvent

Converting Mpeg file to flv and simultaneously playing the converted file in flash cs3 using as3

坚强是说给别人听的谎言 提交于 2019-12-13 07:16:19
问题 I have an mpg file which I want to convert to flv format, but I have a requirement that while converting the mpg file, I also have to simultaneously play the converted flv file in the flash cs3. How to do it? I am using cs3 and as3. 回答1: If you want to convert your files programmaticly then use ffmpeg. This is a commandline tool which can convert video files to nearly everything. You have to execute ffmpeg with the correct params and wait until the video is ready. This works only on

AS3 trying to import a custom class. Files in wrong order?

拥有回忆 提交于 2019-12-13 07:15:36
问题 I posted my original question here. Which got me to this point. I think I'm doing everything just as @Atriace suggested, but I get this error: C:\Users\User\Desktop\oldProjects\nealdavis\calculations\GeoMath.as, Line 1, Column 1 5001: The name of package 'nealdavis.calculations' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:\Users\User\Desktop\oldProjects\nealdavis\calculations\GeoMath.as Since, I think I'm doing