ActionScript 2.0 :: Movieclip To Go Under Or Over A Certain Amount?

Mar 30, 2012

titles a bit vague, i had no idea what to call it, i am sorry if this is a stupid question, i just can't find the answer anywhere.

I am using AS2 and i want to create an enemy, but i need it to spawn randomly. yes i know, use random. but i don't want the movieclip to go under or over a certain amount.

i want the movie clips y axis to be over 122 and under 292 (i gave up trying so i just have it set at the highest i want it to be

newenemy._y = random(292)

i want it to be something like random(122,292). but that doesn't work might mention i am extremely new. only started using as2 last week(from memory, i used to just copy all codes i didn't know and the only thing i added myself was key.isDown things)

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Video Amount Played MORE THAN Amount Loaded?

Feb 11, 2012

I have been having a serious issue with custom video where flash is saying that the amount of the video so far played is MORE than the amount that it has downloaded, which is clearly impossible. This results in various problems, such as the playhead (scrubber) moving past the end of the loader bar. I posted a simple demo that displays the amount loaded and the amount played in text fields. You can see it at: [URL][Code]...

View 5 Replies

Actionscript 2.0 :: Video Amount Played More Than Amount Loaded?

Feb 11, 2012

So I have been having a serious issue with custom video where flash is saying that the amount of the video so far played is MORE than the amount that it has downloaded, which is clearly impossible. This results in various problems, such as the playhead (scrubber) moving past the end of the loader bar.I posted a simple demo that displays the amount loaded and the amount played in text fields. You can see it at: URL...[code]I encoded the video at a high rate so that it would download slowly. It may not playback smoothly, which I am not concerned about. What I am concerned about is the numbers below the video what are derived from ns.bytesLoaded and ns.time. If you watch it for a bit, the amount played should exceed the amount loaded.

I double checked the video duration and the bytestotal that flash is reporting and they are correct. I don't know of any way to check the accuracy of bytesloaded.If your internet connection is super fast, you may not see the issue - it only occurs when it is playing back faster than it is downloading - if this is the case, you may need to throttle your speed down, or start downloading a large file while you are watching this demo in order to see the issue.But this is a serious issue and means that building custom video interfaces with loadbars and playheads is impossible!

View 1 Replies

Removing A Movieclip From Stage After A Set Amount Of Time

Jun 26, 2009

I've got a movieclip animation which is added to the stage at the start of the .swf.Its an introduction to the game, and the user is encouraged to click on the movieclip to start the animation.Once the animation is finished I'd like the movieclip to be removed from the stage.Do I need to setup some sort of event handler which listens out if the movieclip has finished then start a function once its finished to remove it from the stage?  Which methods look out for movieclips finishing?

View 1 Replies

ActionScript 2.0 :: Add MovieClip From Library Then Disappear On Certain Amount

Jan 18, 2010

How can I increment attached movies once I hit a button? And returns to zero when it reached a certain amount.

Example.
There's a movie clip with an instance name of "release".
Once clicked
A movie clip will appear from the library.
and it adds another movie clip when clicked again.
And adds and adds and adds... until it reached 10 movie clip visible in the stage. When it reached 10, all of the called movie clips will disappear.

View 3 Replies

ActionScript 2.0 :: Alpha Of MovieClip To Rise And Low At Set Amount

Jul 12, 2002

I am still new to actionscript. What I want to do is set the alpha of a movieclip to rise and then lower at a set amount. I can do it so it set it at random but not the way I want it, e.g., clip starts at 20%alpah, and rised by 1 until it at 50% and then reduces by 1 until back to 20% over and over.

Second frame :
i = i+1;
setProperty ("/grid", _alpha, +i);
result = getProperty("/grid", _alpha);
if (result = 50) {
setProperty ("/grid", _alpha, 50-i);
}

Third frame.
gotoAndPlay (2);

View 2 Replies

ActionScript 3.0 :: Removing A Movieclip From The Stage After A Set Amount Of Time?

Jun 26, 2009

I've got a movieclip animation which is added to the stage at the start of the .swf. Its an introduction to the game, and the user is encouraged to click on the movieclip to start the animation.Once the animation is finished I'd like the movieclip to be removed from the stage.How do I go about doing this? Do I need to setup some sort of event handler which listens out if the movieclip has finished then start a function once its finished to remove it from the stage?

View 3 Replies

ActionScript 2.0 :: Put A Timer On A Movieclip So That It Appears And Disappears After A Certain Amount Of Seconds?

Aug 12, 2009

how to put a timer on a movieclip so that it appears and disappears after a certain amount of seconds

View 1 Replies

ActionScript 2.0 :: Run A Function Where After An Amount Of Time Of The Mouse Being Idle A Movieclip Plays?

Jan 19, 2012

I'm trying to run a function where after an amount of time of the mouse being idle a movieclip plays, then if the mouse moves another one plays. I have gotten my code to do this, but the last function runs over and over as the mouse is moving. I want it to run once, so the movieclip plays once. how do I do this?

here is my code,

standstill = 0;
lastmove = 0;
timeout = 3000; // 1000 ticks = 1 sec

[code]....

View 1 Replies

ActionScript 3.0 :: Error 1009 - Add A Movieclip With The Amount Of Points Scored When A Hit Test Occurs

Jul 15, 2009

i am trying to do is add a movieclip with the amount of points scored when a hit test occurs. I have a movieclip with some text and a motion tween. i add this with this code in the hitTest function:

[Code]...

View 2 Replies

ActionScript 2.0 :: Run A Function When After A Specific Amount Of Time Of The Mouse Being Idle A Movieclip Plays?

Jan 20, 2012

I'm trying to run a function when after a specific amount of time of the mouse being idle a movieclip plays, then when the mouse becomes active again a different movieclip plays. I have gotten my code work for the most part, but the last function runs over and over as the mouse is moving. I want it to run once, so the movieclip plays once.

here is my code:

standstill = 0;
lastmove = 0;
timeout = 3000;

[code]...

View 1 Replies

ActionScript 2.0 :: Set Scroll To A Certain Amount?

Sep 12, 2011

I have a gallery with a vertical thumbnail filmstrip on the left. There is an up and down button on the thumbnail strip. I want to set the up and down buttons to scroll a set amount of pixels. Is this possible? How?

I know the height of the thumbnails are 130 px each. If I could set the buttons to only go up or down that number of pixels on click, it would scroll the height of just one image thumbnail at a time per click, right?

Here is what the up button is set to now (using a stock template gallery fla) and it jumps around- not a one-by-one scroll like I need[code]...

View 2 Replies

IDE :: Timer - Decrease Every Second By Set Amount

Mar 22, 2010

I've been developing a flash game with a friend, and have hit a minor snag with the timers. My entire game runs in one frame, spawning movieclips and handling all that game-related stuff. Thing is, I've got a timer that spawns one thing (a boulder, in case anyone is wondering), and I'd like to have that setInterval (milliseconds) decrease every second by a set amount.

The important snippet of my code looks like this:
var timeb = 750;
bfalltimer = function () {
spawnboulders();
if (gaslevel<=0) {
clearInterval(boulderspawntime); }};
boulderspawntime = setInterval(bfalltimer, timeb);

Every second, I'd like time to decrease. I've tried everything I can think of - did I miss anything? How would I properly do this?

View 2 Replies

Actionscript 3 :: Dynamic Amount Of '.parent'?

Aug 25, 2010

I have 2 object. In different depths of MovieClip. I would like to know if object A parent is same with object B parent. I wanted to dynamically add '.parent' to object A/B till it both reaches the same level (having the same parent object). How can I do that?My idea was to have something likeobjectA = objectA + ".parent"and make it loop till it reaches the target. But this is not the correct way to add in more layers of '.parent'

View 2 Replies

ActionScript 3.0 :: What Is An Acceptable Amount Of CPU Usage

Jul 17, 2009

I'm building a media player with alot of tweens in the interface , I'm wondering what is common or exceptable in the professional flash community.When I tween the whole Interface into another view firefox spikes to 12 - 16 cpu on a 3.01 GHz duo-core. Is this normal? acceptable? After the tween Firefox flunctuates between 2 - 8 cpu while idle.

View 6 Replies

ActionScript 3.0 :: Max Amount Of Event Listeners?

Jul 31, 2009

well i wish to know, whats the maximum amount of events which can be called?

previously in as2 i ran into this problem when i kept using roll over and roll out events. and very quickly it reached its limit. so i wish to know what the maximum is, and is there any efficient way of asking flash how many are being called?

View 2 Replies

ActionScript 3.0 :: Moving An Object A Certain Amount

Aug 26, 2009

I have a square box, which is larger than the stage. The box can be moved around the stage, using the startDrag/stopDrag methods. The box starts a 0,0 and gets moved with the mouse...

ActionScript Code:
board.addEventListener(Event.ENTER_FRAME, boardMiniMapLocation);
public function boardMiniMapLocation(e:Event){
if(board.x >= 0){

[Code]....

In the above, the first two if statements work, it is just the last one that doesn't work.

What is supposed to happen, is when the board is dragged to the left, and it hits the boards right edge is equal to the right edge of the stage, it is supposed to not allow the board to move any more to the left.

View 1 Replies

Preloader - Load A Certain Amount Of Content?

Jan 2, 2011

I have a preloader that I downloaded... What I want to do is have this load only a certain percentage of the move before it continues to play the file.I assume that I have to edit the line of code that gets the total amount of bytes for the file itself... expressed below:

Code: Select alltotal = this.getBytesTotal(); // Movie Length

Since the variable is 'total' how do I make it load only 25% then start? I

Code: Select alltotal = this.getBytesTotal(25); // Movie Length ?
Code: Select alltotal = this.getBytesTotal() * .25; // Movie Length ?

View 1 Replies

ActionScript 2.0 :: Pull Only The Accurate Amount?

Nov 7, 2004

I am with a small problem, is the following one, I have my main file that this calling 10 swfs external, example in frame 1 calls one swf, in frame 150 calls another one, in frame 230 calls another one and thus it goes until completing the 10 swfs, I am using something thus for each swf "tran1_mc.loadMovie(_root.i11)", in the HTML if I to place 10 swfs it pulls normal, all certainty so far, but if in my HTML to say only it to pull 3 swfs, it pulls these 3 swfs and the remaining portion is blank, what necessary to make it is when to finish to show to this 3 swf it comes back to the first one, somebody has an idea of as I can make this?

View 5 Replies

ActionScript 2.0 :: Add $5 To The Total Amount Of Money

Apr 10, 2005

i want it to add $5 to the total amount of money, but the problem is, is that my code doesnt work, in the frame actions i have:

[Code]...

View 4 Replies

ActionScript 2.0 :: Thumnails And Their Amount On The Page?

Oct 25, 2006

There is a several amount of thumbnails. Their number depends on the screen resolution or on the size of the window.Anytime the screen resolution or the size of the window get smaller, the amount of those thumbnails gets smaller, too and the rest of them moves to the other page, therefore you have to keep clicking button "next" to see all of them (thumbnails)at the end.

View 5 Replies

ActionScript 2.0 :: Make A MC Keep Moving A Certain Amount?

Jun 23, 2003

Does anybody know how I could make a MC keep moving a certain amount when I let go after dragging it. I want the distance it goes to be based upon how quick I moved the mouse before I let it go.

View 5 Replies

ActionScript 3.0 :: How To Manage Amount Of Movement

Mar 9, 2010

URL...The problem is controlling which are the elements to be moved, and mostly, how to manage the amount of movement. When I open a submenu, I've got to move all the subsequent buttons down. But when I close a submenu, I've got to move them up. If I'd do it in different times, no problem.

View 5 Replies

ActionScript 2.0 :: Rounding To .25 .5 .75 Or Getting Decimal Amount?

Sep 20, 2010

I want to get the amount of a number after the decimal place in order to round the number in increments of .25, .5, .75, or the next whole number.

For example the number is 5.13 it would produce 13 which I could check if < 25 and then round to 5.25 and so on for .5 .75 and the next whole number.

View 4 Replies

ActionScript 2.0 :: Only Play For A Certain Amount Of Frames?

Jan 9, 2011

I used some code made by another user on this site to create falling snow. It works perfectly but there's one problem.I want it to only play for a certain amount of frames, but i dunno how to make it stop or disappear, btw, its my animation is all on one scene.

View 1 Replies

ActionScript 3.0 :: Call A Function After A Certain Amount Of Time?

Apr 7, 2009

I have a piece of code, and in that function i call to another function that has 3 parameters.now i've decided that i want that last function to be called after a couple of secs, instead of immedietly. I can't simply use a timer, and addEventlistener, because then i cant give parameters.

View 14 Replies

ActionScript 3.0 :: Loading A Predetermined Amount Of Frames?

May 12, 2009

OK so I screwed up. I didn't plan properly for a project and now the client is saying that the loading time is long (2 mb). Is there anyway I can load just a certain amount of frames and then play them? (External SWF)

View 2 Replies

ActionScript 2.0 :: After A Specific Amount Of Time Have A Link Appear

Nov 12, 2009

I am using CS3. Here is what I am trying to accomplish:

On my loading page I have the following standard loading code:

Code:
stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

[Code].....

Because on some connections this can take quite some time, I want a link to appear after a specififc amount of time, say 10 seconds? Kind of like a, "loading too slow? Click here for whatever."

how to accomplish this within this loading code and frame?

View 4 Replies

Scrolling Large Amount Of Text Through Banner

Nov 14, 2011

I have this banner that needs to have a several rows worth of paragraph text animate horizontally through it. Ideally, the text should also be possible to update from outside of flash. As for the scrolling text, working with that much text as one long row of letters doesn't seem feasible, so I'm wondering is there a standard way in Flash CS5 of working with large amounts of animated text? Not the user editable kind like text fields and such, but presentational text.

Obviously it's not efficient to have one long string of text that extends several screens beyond the display, as is the case now. Editing just one letter can take several seconds of scrolling as the string is currently over 3000 px wide, and it's not even all the text that's going to be in the final animation. It'd be great if it was possible to type that text through some web based cms, and have it automatically transferred to the Flash banner,

View 7 Replies

Displaying A Large Amount Of Text In Flash CS4?

Jun 26, 2009

how to display a large amount of text inside of Flash CS4. I have a 46 page pdf I would like to display but I would really like to keep it internal to Flash...I don't want to link it out to a separate html page if I don't have to (i.e. through a URLRequest). I would like to have one self-contained swf file.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved