Attach movie clip speed increase after 2 min
i am making a game in falsh as2
see this link to understand http://createview.in/try/game.html
this function for one fruit.
so there are 10 functions i want to increase speed of falling fruits after 2 min for making difficulties to user
makegd is function for bonus golden fruit it will come every 3 min
PLEASE HELP ME!!!!!!!!!!!!!!!!!!!!
function makeOne() {
if (seconds>0) {
clearInterval(ranOneID);
ran = (Math.random()*10000+8500);
ranOneID = setInterval(makeOne, ran);
One = _root.attachMovie('n_red', 'n_red'+depth, depth++);
nBalls.push(One);
//trace(allBalls);
One._x = Math.random()*500;
One._y = -350;
One.speed = (Math.random()*3)+2;
One.onEnterFrame = function() {
this._y += this.speed;
if (this._y>Stage.height+100) {
//updateScore(-5);
black=black+1;
for (i=0; i<allBalls.length; i++) {
if (this == allBalls[i]) {
allBalls.splice(i, 60);
this.removeMovieClip();
if(this.hitTest(slider_mc.kat)){
red = red+1;
function makegd() {
if (seconds>0) {
clearInterval(rangdID);
rangdID = setInterval(makegd, ran);
gd = _root.attachMovie('golden', 'golden'+depth, depth++);
goldenBalls.push(gd);
//trace(allBalls);
gd._x = Math.random()*500;
gd._y = -100;
gd.speed = (Math.random()*8)+3;
gd.onEnterFrame = function() {
this._y += this.speed;
if (this._y>Stage.height+100) {
//updateScore(-5);
for (i=0; i<allBalls.length; i++) {
if (this == allBalls[i]) {
allBalls.splice(i, 1);
this.removeMovieClip();
makeOne();
makeTwo();
makeThree();
makeFour();
makeFive();
makeSix();
makeSeven();
makeEight();
makeNine();
makeTen();
setTimeout(makegd,180000);
Thank you Kglad for your quick response.
one thing that not happen
makegd is function for bonus golden fruit it will come every 3 min
it comes after 3 min but it's not single fruit that function work like other fruits.
function makegd() {
if (seconds>0) {
clearInterval(rangdID);
rangdID = setInterval(makegd, ran);
gd = _root.attachMovie('golden', 'golden'+depth, depth++);
goldenBalls.push(gd);
//trace(allBalls);
gd._x = Math.random()*500;
gd._y = -100;
gd.speed = (Math.random()*8)+3;
gd.onEnterFrame = function() {
this._y += this.speed;
if (this._y>Stage.height+100) {
//updateScore(-5);
for (i=0; i<allBalls.length; i++) {
if (this == allBalls[i]) {
allBalls.splice(i, 1);
this.removeMovieClip();
setTimeout(makegd,180000);
Similar Messages
-
Attach movie clips to scrollPane using attachMovie
Hi
I tried to attach movie clips to scrollPane using attachMovie
but could not do it
I tried the following code:
sp.contentPath="emptyMovieClip"
sp.content.attachMovie("boxesRow","boxesRow1",1)
trace(sp.content.boxesRow1)
Im able to trace the sp.content.boxesRow1 , but not seen in
the scrollPane
Can any one suggest me , how can I do this
Pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Thank you very muchhi,
The code is correct....
But, what i want to know is, are using the Identifier name of
the moviclips ???
"emptyMovieClip" should be an Ideintifier name for an empty
clip in the library.
and "boxesRow" should refer an identifier name of another
movie clip in the library...(its should also contain some object
for the visibility check)... -
Attach Movie Clip to ScrollPane
Hi
I tried to attach movie clips to scrollPane using attachMovie
but could not do it
I tried the following code:
sp.contentPath="emptyMovieClip"
sp.content.attachMovie("boxesRow","boxesRow1",1)
trace(sp.content.boxesRow1)
Im able to trace the sp.content.boxesRow1 , but not seen in
the scrollPane
Can any one suggest me , how can I do this
Thank you very muchhi,
The code is correct....
But, what i want to know is, are using the Identifier name of
the moviclips ???
"emptyMovieClip" should be an Ideintifier name for an empty
clip in the library.
and "boxesRow" should refer an identifier name of another
movie clip in the library...(its should also contain some object
for the visibility check)... -
Attaching movie clips to other movie clips
I have mc1 nested like this
_root.mc3.mc2.mc1;
If i want to attach the mc1 from within mc2 timeline to the
_root timeline how can I do this?... I don't want to reattach it
from the library it must be the nested mc1 that is attached to the
root timeline.
Is there a way to attach movie clips to other m.c's in this
way?
regards JI've spent nearly a year creating this site... I just taken a
glance at AS3. And sizeable isnt wrong... mamouth is closer. Other
than having to learn AS3 it would take me months to rewrite
everything. Is AS3 actually that much better than AS2? Either way
im gonna finish the site in AS2 and try and find a work around for
my attaching mc's to other mc's. Maybe one day I will convert it,
but it just looks like an unnecissary headache.
Thanks for your help. J -
Attach movie clips using seperate functions
I'm having a little trouble with the following code. I'm
calling two functions: init() and inittwo() to attach some movie
clips to the stage. If I comment one of them out, the other works
fine and the movement is okay. But as it is, only the "cloud" movie
clips are being attached. I need for the clips in the "dreamarray"
to be attached, and then for the "clouds" to be attached with a
second function. I'm probably not going about this the right way,
but I could sure use some help!
It would also be cool if I could attach the dreams at set "x"
values instead of random distribution. I'm not sure how to set a
seperate x value for each item in the array being attached.
var numClouds:Number = 10;
var fl:Number = 250;
var gravity:Number = .5;
var vx:Number = 0;
var vy:Number = 0;
var vz:Number = 0;
var friction:Number = .97;
var vpX:Number = Stage.width / 2;
var vpY:Number = Stage.height / 2;
var vpY:Number = 400;
var dreamarray:Array = new Array();
dreamarray[0] = "dreamone";
dreamarray[1] = "dreamtwo";
dreamarray[2] = "dreamthree";
init();
inittwo();
function init() {
for (var i:Number = 0; i<dreamarray.length; i++) {
var dream:MovieClip = attachMovie(dreamarray
, "dreamarray" + i, i);
//var dream:MovieClip = attachMovie("dreamone", "dreamone" +
i, i);
dream.x = Math.random() * 1600 - 800;
dream.y = 50;
dream.z = Math.random() * 800;
//trace("functioncall");
//tree.x = Math.random() * 2000 - 1000;
//tree.y = 50;
//tree.z = Math.random() * 10000;
function inittwo() {
for (var j:Number = 0; j<numClouds; j++) {
var cloud:MovieClip = attachMovie("cloud", "cloud" + j, j);
//tree.x = 400;
cloud.x = Math.random() * 1600 - 800;
cloud.y = 50;
cloud.z = Math.random() * 800;
function onEnterFrame():Void {
if(Key.isDown(Key.UP))
vz -= 1;
else if(Key.isDown(Key.DOWN))
vz += 1;
if(Key.isDown(Key.LEFT))
vx += 1;
else if(Key.isDown(Key.RIGHT))
vx -= 1;
if(Key.isDown(Key.SPACE))
vy += 1;
vy -= gravity;
vx *= friction;
vy *= friction;
vz *= friction;
for (var i:Number=0;i<dreamarray.length;i++) {
//i think there is a error here
var dream:MovieClip = this["dreamarray" +i];
dream.x += vx;
dream.y += vy;
dream.z += vz;
if(dream.y < 200)
dream.y = 200;
vy = 0;
if (dream.z <= -fl) {
dream.z += 1000;
else if(dream.z > 1000 - fl)
dream.z -= 1000;
var scale:Number = fl / (fl + dream.z);
dream._xscale = dream._yscale = scale*100;
dream._x = vpX + dream.x * scale/2;
dream._y = vpY + dream.y * scale/2;
//dream._x = dream.x * scale/2;
dream._alpha = scale * 60 + 40;
dream.swapDepths(-dream.z);
for (var j:Number=0;j<numClouds;j++) {
var cloud:MovieClip = this["cloud" + j];
cloud.x += vx;
cloud.y += vy;
cloud.z += vz;
if(cloud.y < 50)
cloud.y = 50;
vy = 0;
if (cloud.z <= -fl) {
cloud.z += 500;
else if(cloud.z > 10000 - fl)
cloud.z -= 10000;
var scale:Number = fl / (fl + cloud.z);
cloud._xscale = cloud._yscale=scale*200;
cloud._x = vpX + cloud.x * scale;
cloud._y = vpY + cloud.y * scale;
cloud._alpha = scale * 60 + 40;
cloud.swapDepths(-cloud.z);Hi Ive just taken a very quick look at your code and Ive
noticed at least one or two mistakes.
you are calling:
init();
inittwo();
before the actual functions have been declared.
Flash works from top to bottom when actioning code so by
calling:
init();
inittwo();
bofore the function has been declared and this will do
nothing as it cannot find the functions to call as they have been
declared AFTER the function calls.
The best thing to do is put any calls right at the bottom and
then you will know everything is ready to be triggered. -
Attach movie clip + INVISIBLE
hey,
is there a way to attach a movie clip and make the object
INVISIBLE (i.e. make the object's alpha 0 as it is attached).
here's the line of code to attach the clip:
holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
35});
-donkeyboyyou can set any additional properties inside your brackets:
holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
35,_visible:false})
or
holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
35,_alpha:0}) -
Hello i asked this in my another topic but that topic was
mainly related with another problem.
my question is;
i have 3x3 square boxes ( "box_mc"s movie clips duplicated
from 1 "box" movie clip on stage)
I want to put a small box (that is movie clip "smallmc") in
front of bigger one(that is one of another mc "box_mc" already
placed on stage). When i click big box( i mean "box_mc") i want to
attach an instance of "smallmc" in front of big one.
i have this code in "box" mc ;
on (press) {
if (this.selected == 0) {
trace("box is selected");
selected = 1;
_root.attachMovie("smallmc","smallmc"+count,getNextHighestDepth(),{_x:this._x,_y:this._y} );
_root.count++;
trace(_root.count);
} else {
trace("unselected");
selected = 0;
_root.count--;
trace(_root.count);
but this code puts "smallmc" under "boxmc" :(( and 1 more
problem ;
i have 3x3 big boxes; and when i click a "boxmc" it puts 1
smallmc then i click another "boxmc" it puts "smallmc" but previous
one dissappearing.(but this is not prior problem i think first i
should put small boxes in front of big ones)
thank you for your all helps advicesNot sure if this will help but: getNextHighestDepth() is not
a standalone
method - it is a method of a MovieClip. You need something
like:
this.getNextHighestDepth() instead.
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.adobe.com/communities/experts/ -
Hi,
I have a movie clip to which I attach several others always
at the same depth so one replaces the other. I was trying to change
the size of the attached movies by setting the ._width and ._height
properties and also by using the xscale without any luck. I finally
experimented with a tutorial example and got it to work and saw
that the only difference between the code in the example and my own
was the depth which I had set to 1 and the tutorial had set to 0. I
changed my depth to 0 and it worked.
I didn't see anything specifying that the depth had to be 0
and believe I am still missing something. If anyone cna help me
figure out what's going on I would appreciate it.
Thanks
ChrisFrom the location of the code, the relative path to newSlide
is
full_mc.newSlide as newSlide is in full_mc.
Thus you want:
function updateStage() {
full_mc.attachMovie(mySlide, "newSlide", 0);
full_mc.newSlide._width = 561;
full_mc.newSlide._height = 421;
full_mc.newSlide._x = 0;
full_mc.newSlide._y = 0;
Also note that you can do:
full_mc.attachMovie(mySlide, "newSlide",
0,{_x:0,_y:0,_width:561,_height:421});
Look up attachMovie for the optional initObect
parameter. -
Satellite R830-1GZ - CPU usage high ( 25%) and fan speed increase after wakeup
Hello all
The CPU usage of my laptop shoots up to 25% (and beyond) and the fan speed increases dramatically after waking up, but only when I'm using an external mouse (Microsoft Natural Wireless Laser Mouse 6000) - disconnecting the mouse once this has happened does not solve the problem, so I'm always forced to restart my computer if I have let it go to sleep with the mouse connected.
I've noticed that when this happens System Interrupts - Deferred Procedure Calls and Interrupt Service Routines appears in the Resource monitor>CPU>Processes, and seems to explain the increase in CPU usage.
Any ideas on how to fix this would be most appreciated.
I'm using a Toshiba Satellite R830-1GZ with Windows 7 (64 bit). This problem does not happen when I use the same mouse with another laptop (Dell with Windows XP).
Thank you very much.
CMThank you for your reply.
I was using the mouse without installing the software that came with it (IntelliPoint), which seems to have been necessary to obtain the latest driver. So I've installed the latest driver now, but... I've still come across the same high CPU usage problem after wakeup.
If your suspicion is correct, should disconnecting the mouse before putting the computer to sleep (hopefully allowing the process that controls the mouse to close properly) stop this problem from occurring when it wakes up?
Could this problem also occur due to an external keyboard? I'm pretty sure it's the mouse (given my experience of using only the external mouse and only the external keyboard) and my understanding is that keyboards don't require special drivers (at least the A4Tech one I have claims it doesn't)... just trying to exclude all possibilities.
Thanks again for your help. -
Attaching Movie Clips at runtime from library
Dear All,
I have 6 different clips in Library with the Linkage class
given to following names: Class: mc0, mc1, mc2, mc3, mc4, mc5, mc6,
And I want to attach these clips dynamically at run time
using the for loop in AS3.0:
For( var i=0; i<6; i++)
What should be the code for this at runtime attachment?
Regards,
Sridhar BI looked to see if I could find a way to do this, and
convinced myself it's not possible. If it's important to do this in
a loop (I can't imagine why, but maybe you have a reason) you may
wish to add them explicitly with addChild(mc1) etc but locating
them "off stage" then you can reference them with this["mc"+i] in a
loop to change their coordinates to put them on stage. -
Attaching movie clips to buttons
I would like to design a portfolio site in which I have small
buttons that, when moused over, they display, a pic just above it.
Each button triggers a different pic above it.The best way to go about doing is is to use the MovieClip
class instead of the button class. Use the onRollover event. For
example, have a movie clip that displays the image on the second
frame. The use the actionscript: nameOfMovieClip.onRollover =
function():Void {
this.gotoAndStop(2);
If you want to use the button class to accomplish the same
task, then you will have to create an image that you want to
display then under the "over" frame of the button, place the image.
If you want the original image to be there and display the new
image, then just add a new layer and put the image in the new layer
while keeping to original layer. -
So I want to have a movie clip appear on the screen when I
click the mouse. So i click all over the screen and there are movie
clips everywhere.
Then when I click A, I want another movie clip to appear in
each movie clip, and move across the screen.
I can get the second movie clip to appear ontop of the first
movie clip, but only the most recently placed one will move.Thanks for the feedback, you helped me figure it out.
Ultimately is was the linkage that was the issue. I had them linked
as "01", and "02" etc.
All I had to do was change the link names to "1" and "2" and
presto! Thanks for your help.. -
Clips look like speed increased after rendering?
Weird! I have a few different 30 minute training videos, and after applying the 3-way color corrector I rendered. But, now when I watch they look like the speed of the footage has been increased somehow??
The footage I have was shot in 1080p 30fps. I dumbly began editing in h.264 so that's what it is, and there are some alpha channel simple animations done in Motion as overlays to the footage. I believe the Motion settings are Broadcast HD 1080i60.
Any ideas?
Thanks!editing in h264 in fcp is problematic at best. Although it may work, eventually you'll regret it. I'd seriously advise converting all your footage to prores using compressor. You can reconnect to all your existing work by doing a MM to the correct format with media offline. If you make sure that your converted files have the same file names, reconnecting should be as simple as pointing to the correct folder. I'd do a test on one file to make sure the workflow is correct.
-
IMac fan speed increased after upgrading hdd.
iMac mid 2010 i3, I replaced stock hdd to a two terabyte western digital caviar green. After replacing the fan speed rapidly increased. I installed smc and still no resolution.
FIXED THE ISSUE.... This took a little time, but it was a simple fix. The LCD sensor that you have to disconnect from before removing the LCD was the issue. After receiving HIGH CPU fan speeds, I began looking at possible issues. First, I had [http://www.macupdate.com/app/mac/12381/temperature-monitor|Temperature Monitor] Installed. I had all my sensors including the ambient air sensor reading. After I upgraded my HD to a SSD I started getting HIGH CPU fan speeds, but the HD and DVD fan speeds were fine. I looked at my Temperature Monitor and I noticed i had several Temperature Monitors not reading including the ambient Air Temperature (bare with me, these are steps to troubleshoot). After reseting the SMC and PRAM, still nothing. I shut down and disassembled my IMAC again. This time after i removed the LCD, I looked at the LCD cable that you must disconnect when removing the LCD and BAM, I saw the issue. The wires that connect to the Motherboard from the LCD Sensor, inherently like to lay across the screw hole the Bezel attaches to. I have a couple of pinched marked that exposed the wires and when I tighten the bezel down, it shorted the wires and caused the issue. I cut small pieces of electrical tape and covered the bare spots. When I reassembled the IMAC, i made sure that all my BEZEL screw holes were completely clear of any wires. Once back together, I plugged in the IMAC, waited 5 Seconds and turned it on. All is well. I feel this a majority of everyones issues when they take apart their IMACS and put them back together. THe Fan Control SOftware is good, but this was my solution that worked. Hope this helps.
-
No speed increase after 24/7 connection
A couple of weeks ago I replaced my broken HomeHub with a new router on an extension cable (oops), all was fine for a couple of days with the usual connection speed of 1890kbps, it was then that the new router decided it was going to reset several times in one day, dropping the speed down to roughly 900kbs. Router was condemned back to where it came, to be replaced by my old (working) HH 1.5, minus the extension cable.
Having followed a few of the messages posted on here with similar issues I tried to follow the advice given by users.
However even after 7 solid days of connection (reported by HH anyway) I have not seen my speed return.
Line Attenuation does look to be the same as it did when I last saw it, which I think is the max that most routers report, as my name suggests, I am a long way from the exchange, but the current speed is hard to live with..
Any help will be greatly appreciated!!
Many thanks,
Jason.
DSL Connection
Link Information
Uptime:
7 days, 1:40:19
Modulation:
G.992.1 annex A
Bandwidth (Up/Down) [kbps/kbps]:
448 / 896
Data Transferred (Sent/Received) [MB/GB]:
543.18 / 6.14
Output Power (Up/Down) [dBm]:
12.5 / 15.5
Line Attenuation (Up/Down) [dB]:
31.5 / 63.5
SN Margin (Up/Down) [dB]:
15.0 / 15.0
Vendor ID (Local/Remote):
TMMB / IFTN
Loss of Framing (Local/Remote):
0 / 0
Loss of Signal (Local/Remote):
2 / 0
Loss of Power (Local/Remote):
0 / 0
Loss of Link (Remote):
0
Error Seconds (Local/Remote):
4 / 0
FEC Errors (Up/Down):
0 / 7,301,675
CRC Errors (Up/Down):
0 / 1,669
HEC Errors (Up/Down):
0 / 1,218
Line Profile:
Interleaved
Solved!
Go to Solution.as you have a good stable connection but a high noise margin I suggest you contact the mods and ask to get your noise margin reset to 6db which should increase your connection to nearer what you are looking for
contact mods
can take up to 3/5 working days for mods to contact you
it is a filtered faceplate and you need to leave router connected 24/7 with no resets until you hear from the mods
many people with longlonglines use the business hub 2700/2701hgv which has a great reputation on long lines
If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.
Maybe you are looking for
-
Samsung P400 Projector not working with mini-DVI to VGA
I've never had so many hardware problems with a computer before... sigh. Why they labeled a 100-240v 50/60Hz power supply with a sticker that says 100-120V 60Hz is beyond me (Sony did the same with their original US PS3s but that's another tale). Any
-
Can you please help me with this simple (not for me:) issue
Why this doesnt work? public void spl () String a=("moon.sun"); String [] f=a.split("."); System.out.println(f[0]); }
-
ITunes Sync causing Alarms to Disable
Every time I sync my iPhone with iTunes my Alarms get disabled on my phone, I've had a new iPhone via Insurance after dropping it, the new iPhone does exactly the same? Is there any file I can delete on my PC Relating to Alarms only so it stops doing
-
File Upload field wiht Camera option!
Hi, I'm a web developer and I'd like to make my application accessible also from tablet. I tried the website with both default android Browser and Firefox browser; I saw that Firefox it is much more user friendly to touch and fast. In the website the
-
Does anyone know how to sync the pictures folder between a MacBook Pro and an iMac?
I want to be able to load my pictures onto one computer and have the other one(s) sync with that computer so my pictures are all there on both computers.