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.
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 wish to have a function that will take as input a radius value and a magnitude value.
It will return firstly a point (x,y) and also secondly a direction, (vx,vy) which will have a certain magnitude(speed).
The point returned will be a random point within the radius value and the direction will be a a (vx,xy) that moves the point perpendicular to the line segment (x,y) ->(centrepoint).
I have set up a system that spawns barriers for the player to dodge but it appears the functions won't trigger properly from within "if" statements. I've put nots on my code to guide you through what is going on.
I am trying to develop a maths quiz where I need to generate a random number, I then need to generate another random number but this needs to be a multiple of the first number. I just can't work out how I can generate a multiple of the first number.
really great job done in the forum This is my first thread here, and i would like to ask how can someone produce a random number within a complex range.In my case i want to produce a random number in the range [0,90]OR[270,359] and i can't find the way to do this using Math.random . I looked on the internet but in most cases a simple range is used like (2,40) or [4,50] etc.
I have this array that contains the names of various images I want to load into Flash
var imageArray:Array=["image1","image2","image3","image4","image5","image 6","image7","image8","image9","image10"];
Now I want to create 10 different buttons with each button loading in an image. I know there's a way to do this with a for loop without having to make 10 different buttons and writing 10 different functions. Not sure how to correlate the members imageArray with the generated btns.
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.
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 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.
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)
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 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:
In the past I have created a php file that generates the XML and then referenced it in place of the xml file and it has worked. I am trying this with a precompiled flash app and it is not working.
It works if I run the script, save it and then reference that file to the swf. I would rather not generate a file to the filesystem if possible. Anyone any solutions?
I'm working on the UI for a project. I have a question that hopefully is rather simple. But my whole project hinges on whether or not it's possible, so it's important to me.
generate a .swf from another .swf. Let's say I have a .swf that I export from Flash, and it lets the user choose a number of settings for a piece of generative art, and once they've customized it to their liking, can they then click a button that says "save as a .swf"?
Is it possible to have some server-side tech create a custom PDF based on variables entered into a flash app on a website?
I have a simple survey built in flash and I want to give users who fill it out the option of receiving a pdf that tells gives them their answers to their questions and an analysis based on those answers.
I'm trying to generate a pdf using fpdf. What are the possibilities that might be avoiding generating this PDF. The swf and the php works fine I tested it in another server. Is there any areas that I need to do any adjustments in my server?
I have an API that inherits flash.display.Sprite .When I try to generate the ASDocs for the API, The ASdoc shows that my class inherits from flash.display.Sprite, but doesnt link or there is no click-able link to the Sprite's ASDoc. Can anyone tell me what I am missing.
Is it possible to generate multiple thumbnails from a FLV using only as3? The flv is on the same server as the swf so I'm not using any dedicated streaming server. I'd imagine that as long as the flv has load the video you'd be able to pull bitmapdata from a specific time of the flv. My idea is to pull around 8 images from every flv, convert them to buttons and use them as links to specific chapters in the flv. If this is not possible, would it work better with a dedicated streaming server like red5?
Edit: I'd also like to know how to do it if it's possible :) The idea is to not use the server. The thumbnails will only be used within the swif, so no saving to another location.
I am trying to create an image gallery similar to Androids "Gallery" where it is a horizontal scrolling list of images. I am doing this with an HBox and Bitmap objects wrapped in a UIComponent. The problem is I am trying to do this for mobile and having many full size images open in memory causes problems. I have been trying to have the images load right as they are scrolling into view and unload once they are out of view, but the loading/unloading while scrolling requires too much cpu and causes a very choppy and poor UI. What I am looking to do is be able to load several low quality versions of the images in memory so I dont have to do as much loading/unloading. I have tried decreasing the height/width but it dosnt seem to have an effect on memory usage.
I am trying to create a bar chart with an extra Y-axis that maps the %-age of the bars.[code]But i can't seem to be able to generate the second y-axis.This y-axis should have 0% at the bottom and 100% at the top. Then i will provide the data of how many % the column x has. This should be drawn as a red line.