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)
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]...
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!
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?
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.
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); }
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?
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?
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:
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.
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]...
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?
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'
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.
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?
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.
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 ?
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?
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.
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.
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.
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.
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.
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)
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?
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,
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.