Making a random motion "node Nav" where the square nodes attach by a line to another square.I have the first one made and working good so now i need to add the others and I would like to do this without 'onEnter' i have:
but I am stuck 'cause I cant access the movieclips ._x and ._y positions in the same manner (makes me think the method for attaching the movie is not the best route)
Making a random motion "node Nav" where the square nodes attach by a line to another square. I have the first one made and working good so now i need to add the others and I would like to do this without 'onEnter'
[Code]...
but I am stuck 'cause I cant access the movieclips ._x and ._y positions in the same manner (makes me think the method for attaching the movie is not the best route)
I have a very simple flash project that I need to be completed tommorow or my head is in the block! I am new to Flash and Actionscript but work well with PHP so do have some idea of what I am doing but, this has left me stumped and in trouble if I don't get it done! Basically my movie is very simple. I have a background and after a short break my first scene flys on with one link then leaves - then the second with a different link, then the third.
I converted all links to buttons and gave them instance names 'button1_btn', button2_btn' and 'button3_btn' and then added my new layer for the action script. Below is the actionscript I used to make the buttons work:
Firstly, I want to be able to push the space bar on my keyboard during a swf, and for a movie clip to appear on the stage. This is what I have so far: Code: onClipEvent(enterFrame){ if(Key.isDown(Key.SPACE)){ _root.attachMovie("Explosion", "Explosion"+i, _root.getNextHighestDepth()); _root["Explosion"+i]._x = _x; _root["Explosion"+i]._y = _y-20; }} but its not working....
Secondly, I want A movie clip to spawn in the middle of the stage, then randomly travel outwards to the edge of the stage, then dissapear. And this needs to happen over and over, with the same movie clip travelling to a different place each time. This is what I have so far : Code: onClipEvent(load){ timer = 0; i = 0; a = 0; b = 0; [Code] .....
way to attach multiple movieclips from the library to the stage is and name them in an appropriate way, then refer to them as if they were an array: fielder[i]. I have tried a few approaches but the closest I have got is this: (this is attached to a movieclip already on the stage).
Code: onClipEvent (load) { for (i = 1; i <= 5; i++) { _root.attachMovie("fielder","fielder" + [i],this.getNextHighestDepth());
I have used AS2 for a long time, and have decided it is time to start working with AS3. When attaching multiple movieclips with instance names I would normally do this (AS2):
Code: for (i = 1; i <= 6; i++) { _root.attachMovie("test_mc","test_mc" + i,(300 + i),{_x:fx[i], _y:fy[i]}); _root["test_mc" + i]._width = 26.1; }
but I am struggling to get the same effect with AS3. here is what I have so far...
Code: var mcWheel:MovieClip = new wheel(); function attachImages():void {
I've got a flash project with an empty content clip instance called content_mc. Depending on the button pressed, it attaches a movieclip from the library with the name contentDisplay_mc under content_mc. Now the structure of these subclips are pretty much the same with a textbox called Display. The code on Frame 1 of main timeline:
//tell Flash to display special characters System.useCodepage=true; var cssStyles = new TextField.StyleSheet(); var generic_lv = new LoadVars();
I am attaching six movies via the attachMovie method. I have put all six of these instances into an array and everything's going smoothly as all box's move around in random places and bounce around around a little. Only problem is I want to mask all 6 of these instances via setMask so they are restricted to one area but can't seem to figure out how to do that.If that's not possible I would also love to know if there is a way to do collision testing with them and then I could draw a border around the area I want them to stay in and have them bounce around that (I would actually prefer this)
I have a series of buttons, and I want the same code applied to them all, to handle rollover states etc... Normally I'd do this useing registerClass, but in this case the buttons are added to the stage manually so I can't.I could do somehting like this:
I'm new to Flash and just started working on an animated short. In one of the sequences, I realized too late that an object was too far left in the frame and needed to be moved back. Is there a way to do that in all of the keyframes at once rather than doing it one at a time? The thing that needs to be moved is a .png file, not a symbol.
I purchased a flash home page template that had menu buttons at the top that I decided not to use. I removed the buttons, but now there is a 125 pixel blank horixontal space at the top of the stage. I tried resizing the horizontal size of the stage hoping the artwork would move up and eliminate the blank area, but the stage sizes from the bottom up. The layers get cutoff at the bottom and the blank space is still at the top.
The movie is quite complex with many layers and 450+ frames. Have attached the swf file to illustrate how the top of the stage is empty after I removed the menu buttons. Is there any way to get all of the layers to move up by 125 pixels so that they fill in the blank space without having to do each layer one at a time?
Is there a way to do this? I am just now hearing of (and experiencing) all the downfalls of using scenes to create an interactive website. I may have to start the whole thing over at the mid point if there isn't a way to convert it into one It will save a week's worth of work!
I'm trying to alter the registration point of a movieclip that has multiple movieclips within it.
I've entered edit mode of the movieclip using the 'to Stage' alignment option and am trying to align all the display objects within the movieclip at once. I've packed all the objects into a group and am trying to align the left most edge of the group to the registration point.
My problem is that every object's left edge is snapping to the registration point, not just the left most edge of the group.
I thought the whole purpose of grouping objects together was so you could move them as though they are one object.
I'm working on a simple top-down zombie shooter to teach me better AS3 practices. There's one player, can shoot multiple bullets, and a certain number of zombies on screen at once, that increment by one when all of the previous ones are dead.
So, I have everything working great except for one thing: even though I'm spawning multiple bullets, and they go in the correct direction at the right speed, only one moves at a time.
Here's the code for spawning bullets:
Code: // shoot - check to see if the gun can shoot, then shoot it private function shoot():void {
[code]....
I have a similarly structured pair of functions for the zombies, and they chase after the player just fine. If I trace a bullet's name when it collides with a zombie, it always returns 0. I've tried changing the number of bullets that can be spawned, but it remains the same.
Also, the moveBullets function is called from gameLoop(), which is itself called from an event listener for ENTER_FRAME. The movePlayer and moveZombies functions I have are also called from gameLoop.
I have a simple game going now with a character running forward and I have to jump and duck under barriers. I was able to make it all work so that one of my three random barriers I made comes at a random time at you. However, I don't know how to make it so that multiple barriers come at you. I feel I need some sort of loop. How should I alter the code I have already? This is on one of the barrier moveclips, the first part sets the platform and position to come at you and the second part moves that part towards you. P.s. this is in cs4.
I am trying create to move objects (boxes, named box_1, box_2 etc) to positions on the stage (xPos_1, xPos_2 etc) using onEnterFrames. I can make all the boxes move individually, but I cant get them to move together. I am using the following code in an attempt to move 3 boxes.
So I have a simple game going now with a character running forward and I have to jump and duck under barriers. I was able to make it all work so that one of my three random barriers I made comes at a random time at you. However, I don't know how to make it so that multiple barriers come at you. I feel I need some sort of loop. How should I alter the code I have already? This is on one of the barrier moveclips, the first part sets the platform and position to come at you and the second part moves that part towards you. P.s. this is in cs4.
I have the following code in a file called HelloWorld.as:
package{ import flash.display.Sprite; public class HelloWorld extends Sprite { public function HelloWorld() { trace("Hello World"); } }}
I open up a new AS3 file, go to Properties and enter "HelloWorld" in the class field. Then I press ctr+enter to play the resulting swf. Nothing happens, not even a compiler error.
my task is to code a flash application that lets an user take a snap shot with webcam, attach it to an movieclip and modify the self portrait by adding hair, hats, glasses etc. that are available on menu.[URL]..
I managed to get the webcam working when i used it as a document class. When i changed my code so that the Free Transform Tool code is in document class and the webcam script is in Webcamactions.as file, i can't control the movieclips anymore...the movieclips (such as "imagecanvas" where i attach the video). My Mac's webcam light indicates that the function works, but the video doesn't appear in the movieclip.
I'm attempting to attach Flash's UIScrollbar component to a movie clip so I can scroll graphics, pdf links and a series of flv files. I know how to attach the scrollbar to a dynamic text field (drag and drop) and have tried similar processes with the mc but no luck. I feel like it's not as simple as "drag and drop" and that the mc itself needs to have it's x and y's defined and then have script associated (note I'm using as3).
im currently making an "AS3 beat em up" ala streets of rage or double dragon.Currently i have my character moving and a few animations done and i am trying to figure out how to make attacks work.I have some "basic" animation for his attack, but im not sure how to get it to work correctley.What happens is, if you press control (the attack button) whilst the character is walking he just keeps moving and is stopped on the attack frame.I want the character to stop moving if the attack is pressed and once it is released start moving again.
hero.gotoAndStop('still'); var left:Boolean = false; var right:Boolean = false;[code].......
what i have is a tween on a movie clip of a popcorn kernel on one layer and a tween on a button on another layer to follow the movie clip. i want to be able to roll over the kernel and make it "pop". i changed my over on the button to popped corn (this works) but i want it to stay popped for the rest of the tween.
I have a problem when making flash applications with more than one frame that has symbols placed on it in that I can't declare all of the event listeners for the objects at the same time and I have found that even if I put them all on the first frame, add the event listeners, then click through to the next frame then the buttons won't work on that frame.
Does anyone have any idea how I could solve this? I did consider myself a fairly competent AS3 programmer until I realised I had no idea how to handle this sort of thing. Solved: I initialised the clips from my external class and then addChild'd and removeChild'd them as I needed to and placed their x and y on addChilding.
i use loadmovie() to load youtube videos inside my flash website but when i load another video the old one doesn't stop, so i tried unloadmovie to destroy it but it seems that i did a mistake in my code
This is how the code looks to stop the old one an load the new:
I have a group of 16 images that I would like to load 1 of each into each movieclip. I want image1 to be inside of visual1, image 2 inside of visual2, and so on. the images are named like, 1960s_(1).png where the 1960 (year) part is coming from the rangeNum variable. The above gives me this error: 1061: Call to a possibly undefined method addChild through a reference with static type int.
I have some simple script that has 2 "movie clips". What I want to do is to start moving the second movie clip at the same time when the 1st starts moving. (both start moving at the same time) I tried the following script but it never works:
I currently have an over, out and click event for 8 different objects. The over and out events are identical for each (tween expands object and then shrinks it back for the out state).I have previously asked for an easy way to declare those events, and now I was looking for an easier way to handle them.
Here's my code:
//-----------GARAGE function growGarage(e:MouseEvent):void{ scaleTweenX = new Tween(map_garage, "scaleX", Elastic.easeOut, 0.648, 1, 0.5, true);
[code]....
I've tried using a single function and then using "this" as the object of the tween but that expanded the entire stage.