actionscript-2

Flash AS2 Quiz with individual points for each answer

廉价感情. 提交于 2019-12-13 07:25:46
问题 I'm making a quiz in Actionscript 2.0. The quiz has 8 questions. Each question has four answers and each answer gives different points. On every frame their is two questions to answer and then move on to the next two and so on. My problem is that I need to assign each answer with points that in the end will be calculated and depending on the number of points send the user to different messages (frames). My code so far is as follows: // create an array of all nav buttons in group var groupinfo

Shuffle Array, Splice Array. Action script 2

[亡魂溺海] 提交于 2019-12-13 06:19:16
问题 Good afternoon programmers. I am trying to create a game in action script 2. the concept is that the game randomly picks an object. The player has to get the object, then the game calls out a different random object. (these objects are in an array). static private var oneArray:Array = new Array("milk","cheese","bread"); static private var randomItem:String = oneArray[Math.floor(Math.random() * oneArray.length)]; So you can see I've done this. Now the game will display the text; _root.hud

MovieClipLoader.loadMovie() loads a blank image with proper dimensions

大兔子大兔子 提交于 2019-12-13 04:40:55
问题 So after adding support for dynamic images, a la MovieClipLoader, to a project that I'm working on, I came across some strange behavior. In local tests, the requested images load fine and I am able to use them as I like. However, when the .swf is hosted online, the images are not visible, even though I don't get an onLoadError event. This behavior seems rather odd and is obviously not desirable. Through some testing, I found that the dimensions of the images loaded with the MovieClipLoader

load sound dynamically in as2 having problem

旧时模样 提交于 2019-12-13 04:33:46
问题 I want to load sound placed in sounds folder. Code is var my_sound = new Sound(); my_sound.loadSound("sounds/sound1.mp3"); my_sound.onLoad = function(success:boolean){ if(success){ my_sound.start(); } } This plays sound when flash is open and pressing CTRL+ENTER(Test Movie). but when we plays the swf it won't play sound. for this problem i found one solution. i made off onLoad function. and the Test Movie. Now the opposite things happend. It dosen't play when press CTRL+ENTER (TestMovie); but

is it possible to open external swf in new flash player with AS3 or AS2?

心不动则不痛 提交于 2019-12-13 04:24:55
问题 is it possible to open external swf in new flash player with AS3 or AS2? I've been searching everywhere for this, but most of what i found is that it's loading into new browser tab not other flash player. 回答1: There is no function to execute a new Flash Player. If you think in this way: Flash Player is an executable in visitor's computer. If you can launch Flash Player, you can launch any executable you want. This causes security problem. Therefore, you can't launch a new Flash Player. 回答2:

Why do MovieClipLoader events not fire when loaded into an AS3 wrapper?

被刻印的时光 ゝ 提交于 2019-12-13 02:24:54
问题 While trying to answer this question: Call to an AS2 function from the AS3 container I have come across a roadblock. The setup is an AS3 SWF which loads an AS2 SWF, which in turn loads another AS2 SWF. Communication between the AS3 SWF and the parent AS2 SWF is achieved through localConnection. child_as2.swf - This is a very simple timeline animation of a box moving across the screen with the following code on frame 1: stop(); function playMovie() { play(); } parent_as2.swf - This is the

how do i display the coordinates of a random triangle in actionscript 2.0?

人盡茶涼 提交于 2019-12-13 01:41:39
问题 I wanna generate a random triangle with coordinates, which shows the arcs of each corner in actionscript 2.0 with flash 8.0. 回答1: This looks a lot like your previous question (also a lot like this other question), but here goes: import flash.geom.Point; function randomPoint():Point { //return a random point on the stage var p:Point = new Point(Math.floor(Math.random()*(Stage.width-300)), Math.floor(Math.random()*Stage.height)); return p; } function drawTriangle(mc:MovieClip, q1:Point, q2

How do I include a SWC in an AS2 Flash project?

耗尽温柔 提交于 2019-12-12 19:08:07
问题 In AS3, I know how to accomplish this. One needs only to click "ActionScript Settings", and navigate to the SWC file under "SWC Files or Folders Containing SWC Files". However, when the project is set to AS2, the "Actionscript 2.0 Settings" is a rather sparse menu, and adding the folder as a classpath doesn't seem to work. Can this even be accomplished? 回答1: Assuming that your SWC was created for AS2 as a compiled component, you have to add it to your Flash components folder. For me, using

Can an AS2 swf be loaded into an AS3 swf? How can I add this to the stage and interact with it from As3 swf?

两盒软妹~` 提交于 2019-12-12 18:58:08
问题 I am trying to load a swf written in AS2 into an AS3 swf - using Loader class and listening for Event.COMPLETE. in my onCompleteHandler function i want to add this to the stage so Im trying - addChild(evt.currentTarget.content) ... but I get the following error message: Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to a different part of the displayList when it has been loaded into AVM2 (AS3) content. The AS2 swwf has a lot of code and I really dont want to have to migrate to

Problem with starting a Sound at a specified position (AS2)

你。 提交于 2019-12-12 18:10:00
问题 I have an issue with an Actionscript 2 piece of code. I'm trying to load a song and start playing it at the 50th second until the end. var song:Sound = new Sound(); song.setVolume(100); song.loadSound(songToPlay,true); // songToPlay is a valid path song.start(50); This loads and play the Sound, but at the begining and not at 50 seconds like I want. I also tried song.start(50,1); without success. What am I doing wrong? 回答1: In order to start a sound file at a specific time, you have to start