ActionScript 2.0 :: Kirupa Mc Create Duplicates In Both Directions X And -x
Aug 11, 2005
[Code]....
I changed the code a bit because I would like it to work like this...If I put my mc (photo) in the center of the stage, it would creat dups every 125 pixels. But this script only makes one duplicate, I must have done something to mess it up. Idealy I would like to have the mc create dups in both directions; x and -x.
View 6 Replies
Similar Posts:
Dec 2, 2010
I am making a drag and drop game using AS2 in Flash CS5 where mc items are duplicated and enlarged from a menu and can be placed anywhere on the stage to create a custom robot. Each part (arms, head, feet, etc.) is it's own mc with unique instance names. I have the drag and drop part all figured out, and I even have the duplicateMovieClip part working...
HOWEVER... Whenever I move from the current frame that an object was duplicated in, to another frame and then back, the clips dissapear one by one if you try to create a new one. Each list of menu items are in their own frames (heads, torsos, arms, etc.). As the duplicates are made, they remain on stage no matter what frame you go to and can still be dagged around, which is good, but as I said previously, they dissappear when you create a new duplicate. Not all disappear at once, only older created duplicates disappear as you bring in new duplicates.
[Code]....
View 3 Replies
Jul 15, 2004
I currently have a class that has a method that creates new duplicates of a clip on the screen, changes some of their properties (such as color, and text display), and then arranges them in a straight column. Inside that method, I have some clipEvent Statements for each button.
[Code]...
View 4 Replies
Feb 25, 2006
I have a for loop which duplicates movieclips. To call/create the new clips, I use this:
[Code]....
View 1 Replies
Mar 18, 2011
what script i need to add to the code below to create a number of duplicates of the "Player"?
[Code]....
View 1 Replies
Jan 28, 2012
I have a movieclip that moves arround on my stage. I'm looking for a way to tell what direction my movieclip is going in AS3. (up, down, left, right
View 1 Replies
Sep 16, 2010
I have been googling my butt off I can not find anything about AS3 and shooting in different directions.
I just need to shoot in the direction my char is facing.
I have this so far which work flawlessly ;-)
function Shoot(event:MouseEvent):void { trace("shoot");}
oh also I can get the direction my hero is facing using trace "character_mc.rotation"
View 3 Replies
Jun 4, 2009
I'm trying to clone The Legend of Zelda (NES) Link's movement.
This what I have:
PHP Code:
stop();var leftKeyDown:Boolean = false;var upKeyDown:Boolean = false;var rightKeyDown:Boolean = false;var downKeyDown: Boolean = false;var linkSpeed:Number= 7;// Link MovementLink.addEventListener(Event.ENTER_FRAME, moveLink);function
[Code].....
View 13 Replies
Dec 31, 2011
Ok, so I got this huge image of a map. I put a Mask over it so it will fit on a small screen. But....I want users to be able to view the whole map but click on arrow buttons that will transfer them in all 4 directions. I know I can do this with keyframes, showing different parts of them map each stage....But isn't there a simplier way? Some sort of actionscript code that will tell flash to scroll how many pixels left or right or up or down? And that it will know that the image will stop here so don't scroll more than that?
View 4 Replies
Apr 24, 2009
I've a got bar (songBar) on which it will appear the artist and the song name (artist_txt). What I want is when the title_txt width is larger than the songBar.width, the text to scroll from right to left, and when the tween is finished to scroll from left to right (all this tween has to be a loop). If the width of artist_txt is smaller or equal to the songBar.width then artist_txt is aligned in the center of the songBar. All I'm trying to code it's just what you see in winamp player.
Code:
var textTween:Tween;
if (mp3player.artist_txt.width > mp3player.songBar.width){
textTween = new Tween(mp3player.artist_txt, "x", Linear.easeNone, mp3player.songBar.x, mp3player.songBar.width - mp3player.artist_txt.width, 1, true);
} else {
mp3player.artist_txt.x =(mp3player.songBar.width + mp3player.songBar.x)/2
I don't know how to reverse the tween when it ends, how to create the loop and how to stop the tween if the else statement comes into play. i don't want to create the animation on timeline, all I want is code.
View 2 Replies
Mar 18, 2010
I wish to extend upon a basic Google Map. What need to do is make a submit field where people can enter in their postcode and it directs to a preset destination by defining a route upon the map. My test map is here if you wish to view it: [URL]
The Google Map that I have so far has been created by following an excellent tutorial by tunevision: [URL]
Here is the code that I have used including most of the comments:
[Code]....
View 3 Replies
Sep 10, 2011
I created a map with the Google Map API For Flash that shows directions. It creates a line between the 2 addresses and gives turnbyturn directions.
This is working perfectly in Flash test mode locally but once i put it online The map still works but the directions dont show and i get the Failure status 400.
Does anywone know whats the problem here? I'ts driving me crazy just because its working locally but not online.
DirectionsEvent.DIRECTIONS_FAILURE.feature.status = 400
View 2 Replies
Oct 20, 2010
What I have is a circle image (for this purpose lets say it looks like a clock). For example: when you click 3 o'clock, the whole clock needs to rotate around with the 3 o'clock btn at the 6 o'clock position (with the pivot point in the centre). each of the 'time' positions (2 o'clock, 3 o'clock, 4 o'clock ...etc) needs to be a button and thus be able to rotate around to the 6 o'clock position. This would seem simple enough by just using a .rotate value or using tween movieclips...however the tricky part is:
The actionscript needs to determine which way the clock turns (anti/clockwise), dependant on where the clicked time-btn's position is. it needs to be some sort of if statement that says: If (3'oclock-btn) is positioned between 0 degrees (being original 12'oclock position) and 180 degrees (original 6 o'clock position), then rotate clockwise to the 6 o'clock position. If the (3o'clock btn) is positioned between 180degrees and 259 degrees (12 o'clock position), rotate anti-clockwise to the 6'oclock position.
View 3 Replies
Aug 26, 2006
ive been making real simple ads for my friend for about two months now slowly getting more and more detailed but this one i tried alot of new stuff and am getting a lot of new problems. ive searched for the answers and found close stuff but havent been able to adapt it to what i need. Problems:
1. im not sure how to get the chainsaw to only flip directions when i am draging it.(i tried what i could think of but my bag of tricks is small)
2. i found the code to spawn the zombies with random numbers of each and speed but im not sure how to get them on a repeating path after their there.
3. i need a way for the hittest to register once then stop to allow me to play to death animation and get a count of how many have been killed to trigger the clicktag.(i dont have an animation for that so the currently turn black to show their out.)
4.i dont know how to do the hittest on the spawned zombies and they are also ontop of the saw. im sure there are more problems i havent found yet but these are the ones i could think of right now. also i may be adding alot of info you dont need but im trying to be thorough.
[Code]...
View 2 Replies
Jul 27, 2009
am trying to make a game whre i want the sprite to move from positive x-axis to negetive x-axis for 30 seconds and after dat it has to down along y-axis one step.
View 1 Replies
Apr 5, 2011
I already had another question on this issue which was successfully resolved. But now, with a slightly different example, I'm stuck again.I have two states. When I switch from A to B, it resizes correctly, but when I switch from B back to A it happens without the smooth resize transition. What am I doing wrong?Here's my code:
<fx:Script>
<![CDATA[
protected function rollOverHandler(event:MouseEvent):void[code].............
View 1 Replies
Dec 24, 2011
am a day 2 flash user and I have been trying to make a game, but for starters i want to make my character be able to move using arrow keys that includes showing the legs movement instead of a fixed image drifting across.There is one problem, when I press RIGHT arrow key , it goes fine, but when I press LEFT arrow key (rever direction) my character flips from point A to point B instead of facing left, i have been thinking maybe it's the frame problem, is it possible to tell flash to play the REVERSE moveclip
View 14 Replies
Jan 5, 2011
I have a Cube which I want to rotate using mouse motion. So if I move my mouse to the left it rotates as if rotationX was increased. When I move right rotationX is increased. Moving Up and Down alters rotationY.
This looks fine as long as you modify only one dimension (either rotationX or rotationY). But if I have already changed rotationX and then try to modify rotationY the results are weird. If rotationX is 180 rotationY effects are reversed. It basically is quite unpredictable and certainly not suitable for user.
I have tried to look around (failed), read about quaternions (couldn't understand), tried some out of blue and very complex trigonometric calculations (made a fool out of myself) and so I am stuck now. I've found this SO question Best way to translate mouse drag motion into 3d rotation of an object but it doesn't help me a bit, I can't understand any of the answers, really.
View 1 Replies
Sep 27, 2005
Is there someone who is good at trigonometry? I have two points punkt1 and punkt2 and a line that is drawn between them. Both points is dragable. I want the line to continue after the points in both directions and with the same steep. I have counted the steep between point1 and point2 and tried to continue to drag to a point with the same steep, but it doesnt succed.
[Code]....
View 3 Replies
Jan 26, 2007
I wanted a sprite to move round on the screen when a play button was pushed. I have a left and a right button which store strings "left" or "right" into the next positions of an empty array called history.
When i push the play button i want i want the sprite to move either left or right according to what commands are in the array. My code just seems to play one single command and then stops when i hit play again it just repeats the same command.
Is there any way to make it play through all commands in the array one after another?
Here's the loop that i was trying to use.
[Code]....
View 3 Replies
Apr 30, 2008
I'm making a game and need to know how to make enemies enter the stage from random directions, and then move around the screen randomly aswell.
View 1 Replies
Dec 5, 2011
I have made multiple markers via javascript, but trying to do the same in actionscript is proving to be quite challenging.I am using googles directions to retrieve a LatLng to add markers, but it's only returning one marker. Either the first or the second.Within my init function are the markers address array and call to return LatLng from directions. Basically placing the start and end as the same to place the marker.
markers = ['11030 Hartsook st, North Hollywood, CA','15713 Ventura blvd, Encino, CA'];
for (var i:Number = 0; i < markers.length; ++i) {
from.text=markers[i];[code]......
View 1 Replies
Apr 2, 2005
I am making a game that involves a function that makes a bottle randomly explode in all directions. The function is on the main frame of my game and is linked to several movie clips inside the bottle. When the conditions are right, the movie clips should call the function and then fly out in random directions. The problem is, when i put the code directly onto the movie clips it works fine, but when i attempt to use it as a function is makes the entire movie move in random directions instead of the glass shard. My only guess as to why this happens is because this '_this.' command somehow applies to my main frame because that is where the function originates.
View 4 Replies
Aug 25, 2003
Is there a possible way to make an object flip (change directions, vertically or horizontally) using actionscript?
View 4 Replies
Jan 11, 2004
how to actionscript blood for a game. I want the blod to be in a big cluster in the middle and then decrease in size and alpha as it spreads out in all directions.
View 12 Replies
Mar 30, 2003
I am a rookie with this, I copied and pasted from a tutorial. the main page and directions pages work fine, but for some reason the others get stuck when the % reaches close to 100%.
View 2 Replies
Oct 9, 2009
I have a movieclip in the library that I am exporting for actionscript. I duplicate the movieclip by adding a child for each occurance of a tag in actionscript. This works fine, but I can't figure out how to change the y postion of each new child to be 30 pixels below form the last child. Here is a snippet of the code where I am having the problem:
for (var i in xmlData.region){ for (var k in xmlData.region[i].regionInfo.payment);
var mcRI:regionInfo = new regionInfo(); this.addChild(mcRI); mcRI.txtPayment.htmlText = xmlData.region[i].regionInfo.payment[k].card; mcRI.y += 30; }
}
Instead of each new child's y position changing +30, every duplicate is on top of each other at +30.
View 3 Replies
Feb 8, 2005
I have created a movie clip ("container_mc") and then created 5 clips within "container_mc." I want to duplicate "container_mc" twice, along with its contents.One will positioned to the left of the original and one will be to the right.When I attempt this, I am able to duplicate "container_mc." However, the duplicates do not have the 5 clips in them.
View 1 Replies
Oct 2, 2005
Ive got a little problem here. You can see im duplicating some movieClips, in a for loop. They have some XML values, but thats not important. When i click one of the movieClips ive duplicated, ive set it to add one to the "length" variable. But i somehow need it to run though the code from start, when i press that button. And if its possible, to delete all the duplicates it made before.
[Code]...
View 4 Replies
Nov 3, 2009
I am creating an educational game. I have several arrays. These arrays have duplicate problems and that is fine. The problem is, I do not want the duplicate problems to appear right after each other. I have a function that randomizes the arrays. I am trying to create a function that, if a duplicate is found immediately after the original, it will be moved to the end of the array.
So far I have this...
function noRepeat(){
var len = aNineb.length;
for (i=0; i<len; i++){
before = i - 1;
trace("aNineb = " + aNineb[i][0]);
[Code] .....
But it never gets to the extra problems. Do I need to pop it or slice it out before I push it to the bottom? And, how could I make this a prototype thing, so I could just type in aNineb.noRepeat(); ?
View 1 Replies