ActionScript 2.0 :: Randomly Moving Pictures Over Each Other?
Aug 19, 2003I use Flash 5
I went to this (click HERE) site. After a moment, it takes you to the main site.
The top banner is moving randomly over 3 or 4 pictures.
I use Flash 5
I went to this (click HERE) site. After a moment, it takes you to the main site.
The top banner is moving randomly over 3 or 4 pictures.
I managed to make some code that works perfectly which, when the flash game is launched it randomly inserts a picture from the list you give it (word1.png, word2.png etc.)It works fine! But the problem is the place in which it appears, when i start the pictures appear in the top left corner of my flash game, but I want them to appear at preferably the location of a symbol or the x & y coordinates I specify (In actions obviously, i dont want to type these coordinates in game :P).Btw here is the code
var _loader:Loader = new Loader;
var _pictureArray:Array = ["word1.png", "word2.png", "word3.png"];
var _whatPicture:Number = Math.floor(Math.random()*3);
[code].....
I want to fade pictures in and out, but randomly. Kinda like KrazyDad's cloud fly through. I looked at the code for that, but couldn't figure it out. I want to use an array to load the jpegs, and then cycle through it constantly.
Code:
randomPics = random (pics.length);
I just don't know how to fade them in and out. I grabbed this from a fla that faded pictures in and out using buttons
Code:
fadeIn = function () {
if (this._alpha <= 100) this._alpha += 5 ;
else this.onEnterFrame = null ;
[Code]....
I think I might keep my hands away from programming after this. Actually I have 1 more thing I wanna do, but then I will!
I'm running through the tutorial on this photo gallery, but I would like to modify the code some. Instead of loading the first picture in the XML array, I'd like to have it randomly load one of the pictures. Below is the code that loads the first movie:
Code:
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0; picture.loadMovie(image[0], 1);}}
I don't know much, but I'm thinking there should be some variant of "math.random" around the
"loadMovie(image[0],1);"....
I'm currently working on a site where the background pictures (wallpapers) loads randomly with xlm.Loading of the pictures working properly until I try to put the AS: (stageResize/stageListener) it doesn't load.I have tried numerous things but it's still not working.
I've used the following script:
Code:
Stage.scaleMode = "noScale";
Stage.align = "TL";
stageResize = function () {[code]...........
I trying to randomly jump to a frame in a sequnce of pictures on the timeline. Neither of the parts work below - the first "if/then" statements or the commented out switch code. Very frustrated with Flash CS5. Do I really need to learn AS3 to use CS5? I'm having other issues with code I've used in CS3 Flash not working in CS5. If I'm setting the publish settings to AS 2 and Flash Player 8 it should work, right? [code]...
View 5 RepliesI have a project that contains 8 UILoaders that are "housed" within movie clips. I realize that you can not move the component, but I read that you can move it IF you put the loader inside a movie clip. I'm able to get the movie clips to move now, however, the pictures (which are in an xml file) will not load now. Dang the bad luck! They loaded before I changed the loader to within a clip - so now it moves but won't load.
View 1 RepliesUgh how to start...Each thumbnail image is a link which enlarges to an easel to the right with a neat effect. If you move the cursor over a thumbnail it has a little effect on it (very transparent "snow" like on a TV screen) I don't know why Flash keeps "moving" (if you call it that) the snow effect on top of the thumbnails when I open the file at a later time. All I remember doing is just editing simple text and swapping one bitmap thats not even tied to the thumbnails.
I can still click the thumbnails and they open to the right just fine. I just don't get why the "effect/link" moves on top of the thumbnails. If I delete the snow it deletes every effect on the website so they won't enlarge to the right. I don't care if I lose the effect but I don't remember/know how to make each thumbnail a link so they open on the spot I want.
I want to have a few movie clips moving randomly over my flashsite. They will look bugs. And I want them to move in the direction the head is pointing.I have tried the random movement tutorial here on Kirupa but can't get the mc to rotate in the direction it's moving.
View 14 RepliesI am creating a banner with a "moving target", but the target keeps moving under the copy text of the banner, making it illegible.here is my random movement code (Swiped from kirupa if I recall ) :
//special thanks to Suprabeener for the code
function getdistance(x, y, x1, y1) {
var run, rise;
[code].....
I am creating a banner with a "moving target", but the target keeps moving under the copy text of the banner, making it illegible.
here is my random movement code (Swiped from kirupa if I recall ) :
//special thanks to Suprabeener for the code
function getdistance(x, y, x1, y1) {
var run, rise;
run = x1-x;
[code]....
I have tried modifying the " width = 300; height = 180;" line, but it does not seem to be changing much, if anything. I am trying to bound the random movement to the bottom 180 pixels of the composition.
lets jsut say like were randomly moving a moveclip around how do i click on it and stop it?
View 3 RepliesI wasn't quite sure how to describe my problem in the subject. I have a plane MC and a crate MC. The plane only flies along the y axis from the bottom of the screen to top. Along the way I want it to randomly drop the crate MC. My code is below. The problem is that the crates spontaneously keep spawning and not near the plane.
function movePlane():void
{
var tempY:Number;
[code].....
I'm working on my first game engine with AS3 and I'm hitting my first real setback. The idea is that the player controls a centered "turret" on the screen and can't move. Enemies come from all 4 sides and move towards the player. I have all the enemies spawning, randomly, on the edges of the screen. However their movement is silly, because I've coded it like this:
Code:
if (x > 300)
{
[code]........
I want the final result to be a stage with a certain number of circle MC's moving around. I have made the circle MC, and added the AS so that it will start at a random point with a random color, then start moving around randomly. I want to make it so that In the beginning the document will duplicate the movie clip x amount of times, using a for loop. I want to then have all the new circles move around, and when two circles hit each other, they will dissappear, using the removeclip function. You can only use this on duplicated movieclips though, so how would i make all the circles duplicated? Is there a way to duplicate the original movieclip x amount of times then delete it? Or is there a way to remove the original after it is in a collision? Also I don't know how to do the collision detection. I am thinking of using a hittest, but would I just do it with a for loop? Is there a way so that if an MC hits any other MC?
View 3 RepliesMaking a ship game because I am incredibly original.. With that aside, I have a problem. I have a function to fire bullets from my ship based on its rotation which works.. it uses this code on creation: ember ho jis ny mmujhe block kia hai
[Code]...
The above code is in my Ship class so I can easily make the bullets achieve the correct rotation. And to continually update its position, in the bullet's class:
x += Math.cos(rotation / 180 * Math.PI) * speed;
y += Math.sin(rotation / 180 * Math.PI) * speed;
So that all works well. But I have another class, EnemyBullet, which randomly generates and uses similar code to set its direction and movement. In my ship class:
[Code]...
I gather that the rotation is therefore always horizontal, but can't for the life of me see why? Can anyone give me an answer? Assuming it's simple enough because the code I used to setup the rotation is the same working code I have used to turn a movieclip towards the mouse..
I have gone through the tutorial on this site regarding random movement. But I need it to be kept in a frame. This is the code(from this site)
Code:
function getdistance(x, y, x1, y1) {
var run, rise;
run = x1-x;
rise = y1-y;
return (_root.hyp(run, rise));
} function hyp(a, b) {
[Code] .....
Lets say I make an physical border for the element. A "box" 200x100 and this box is centered. How do I keep my random moved element inside this "box" or frame you may call it.
I have a bunch of dots moving randomly on the screen. They are all copied and pasted versions of one MC with some script attached.Over the top of them is a giant invisible button. When I click the button (anywhere on thescreen) a VISIBLE button appears. When I click again (anywhere onthe screen) I want all the randomly moving dots to move towards the VISIBLE button.
View 2 Replieshow to randomly animate circles moving around inside a bigger circles? the small circles will have a collision effect on each other and on rollover of each individual circle, the name of it will come out in the bottom.. so the big circle will act as a wall preventing them from coming out..
View 1 RepliesI'm having two problems. First of all, the gallery loads all pictures at once. The more pictures in the XML file, the slower they all load. Secondly, I wanted the pictures to scroll in its _y coordinate, similar to Sugar Rhyme's website portfolio (see url]...).
View 1 Replies[URL] Take a look at that website. See whe you rollover one of the pictures, the other pictures fade out...Well how can I do that? I've tried some swapDepths techniques but it gets a bit confusing.
View 2 RepliesOnmy stage I have a MC, and when I click it a random MC from the Library should appear and move around randomly.
I'm using this to make it move around randomly [URL]
how to make the random MCs appear from the library. And should I put the random moving script on each of my ten MC?
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.
View 11 RepliesI want to know how i can moving my scene by moving a mouse over them.
to understand what i want exactly ckeck this link :- [URL]
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:
[Code]...
I currently am working off of a flash template. In the header of the flash template are a few pictures that show up like a slidshow. I was wondering how I add more pictures for the slideshow.
View 13 RepliesI am trying to get each of the following pictures in my flash file to link to different webpages. I have tried a bunch of different things, and can't quite get it to work right. I have put different urls on the images, but when I click on them they all go to that first url.
View 1 RepliesHow come that my animations allways flicker/chop. I want a pictures to move from left to right, kind of a slideshow ye. But it flickers all the time, and it is anoying. They all move 1px each frame, and the width of the scene is around 900px. It really flackers no matter what fps I pick
View 2 RepliesI'm trying to make my own photography website using flash. I have a basic outline/template or what I want it to look like and all of the action script to connect the pictures but I'm missing the main things. The pictures. I have html embedding codes for all of the images and would like to use those somehow instead of just having to manually copy and resize my pictures into the actual flash document (because that takes up a lot of space and makes loading longer, I think).
View 2 Replies