Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Problem With Accurately Positioning My MC In A Circle Of Circles



Hello! I have a problem with accurately positioning my MC in a circle of circles. I have tried the following formulas with no success:radians = degrees* Math.PI / 180 degrees = radians * Math.PI / 180andball.x = centerXs + Math.cos(angle)* radius2 ; ball.y = centerYs + Math.sin(angle)* radius2;This is my code:for(var i:Number=0; i<list.length();i++){ ball = new Ball2(10) //ball.x=?????????? //bal.y=?????????? addEventListener(MouseEvent.MOUSE_DOWN, onDown); addEventListener(MouseEvent.MOUSE_UP, onUp); addChild(ball); handles.push(ball);}Pleas help!Ola



KirupaForum > Flash > ActionScript 3.0
Posted on: 01-15-2009, 08:23 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Circles In Circle
Anyone know where I could find some code on how to produce a few small circles randomly moving around inside one major circle? The major circle's border reflects the smaller circles and keeps them contained inside it.

I am trying to finish a project and I need to imitate a basic molecular level model with protons and neutrons.

Really appreciate any feedback.

Thanks.

Drawing Circles And Arcs Of A Circle With CurveTo
Hello,

I want to program a class that can draw circles, just by giving the radius, and middlepoint as parameter to the constructor of the class.

and

I want to programm a class that can draw arcs of circles, by giving paramters:
startpoint, endpoint, midllepoint
or
startpoint, angle, radius
I thought the best way to do that, is with curveTo. But unforunatedly it is hard to find out how the first two Parameters of this Mehtod work exactly. Can you give me a hint?

Maybe you got a samplecode for drawing a _perfect_ circle with curveTo?

Thanx,
Robert !

Circles In Circles Animation
hi there.. anyone know of any tutorials or any codes on how 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..

yeah, by the way i have attched the file so more or less u will understand wat im saying.

really appreciate any feedback or help..

thanks....

Circles In Circles Animation
hi there.. anyone know of any tutorials or any codes on how 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..

yeah, by the way i have attched the file so more or less u will understand wat im saying.

really appreciate any feedback or help..

thanks....

Create Circles... Add Circles..
hello guys! I still have problem on my 'drawing/creating/adding circles..' When i click at first time, the circles seems great! But after that.. my code will create bigger circles but then the circles created before will dissapear anyone to help? please check my attached files.. i've included *.doc file for more info about my question besides *.fla file.. thanks for whoever that are willing to help..

Circles In Circles Animation
hi there.. anyone know of any tutorials or any codes on how 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..

yeah, by the way i have attched the file so more or less u will understand wat im saying.

really appreciate any feedback or help..

thanks....

Circles In Circles Animation
hi there.. anyone know of any tutorials or any codes on how 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..

yeah, by the way i have attched the file so more or less u will understand wat im saying.

really appreciate any feedback or help..

thanks....

Setting _alpha Accurately
Hi all, I'm trying to make a function that alters the alpha of a clip. In it I set a variable, set_alpha, for the clip alpha to be. In an enterFrame action, if current alpha is not equal to set alpha, the clip alpha would be +=1 or -=1 depending on is it smaller or greater than the set alpha.

My problem is, let's say i clicked a button that sets the preset set alpha to 30, the clip is now at alpha value of 5. So the clip alpha would add 1 each frame. I used a trace() to track the clip's alpha progression. It displays a fractional number (not whole, something like 24.6475), so the clip would blink for some time before reaching alpha value of 30. I've read that the _alpha system is 128 levels mapped to 100 steps...

Does anyone have an idea on how to progressively increasing the alpha value predictably , like in my case, make it reach a desired value without blinking ? Or any idea why Macromedia set the alpha system like this ? Or can I access those 128 levels directly (using 1-128) ?

any comments would be great!
thanks in advance...

orry

How To Accurately Detect A Webcam?
I've been having problems with the Camera.get method returning drivers that are not even web cameras. For instance, I connect with one computer and the camera name is called "ATI T200 AVStream Analog Capture" - this is not a webcam.

So my question is, is there anyway to accurately detect one? I even tried messing around with motion detection, and while there is no video output from the driver mentioned above, the motion fluctuates between values 0-6.

How To Accurately Display Movie Framerate?
Can anyone help me out with a script to accurately display my movie's frame-rate in the corner of the movie. I have seen this in other movies but haven't really got a clue how to do it myself.

I know my movie is not running at a constant frame-rate and don't really expect it to but knowing how much the rate is changing would be nice.

Thanks in advance,

Chris

Flash Displays Accurately ONLY On Some Browsers
I have a flash animation that is on a website I am working on and how it is set up, I have the movie on the left and text on the right. The text on the right has a certain color background. When the animation ends, the background of it is supposed to fade to the same background color as the text on the right but only happens in firefox or camino etc. In internet explorer or safari the movie fades to a lighter color than I had set it up, can anyone please help me? It is driving me insane!

Website link is http://www.vipedesigns.com/3vnewsite

Internet Explorer 7.0 IMAGE

Firefox 2.0 IMAGE

Regards,

Vlad






























Edited: 01/05/2007 at 12:10:13 PM by ObsoletePower

Accurately Jumping Around In Animation/audio
Hey guys, I'm learning AS3 as I modernize the VCR controls for our e-learning topics. The way we used to do it was load the wav into the timeline and keyframe to the audio. We have a little tracker bar you can click on to jump around, a tracker icon you can drag, play/pause and FF/RW buttons. In AS2, since the wav was in the timeline, I just had to worry about frame numbers.

It seems like the modern way to do it is to load the audio as an MP3 externally. How accurate will this be as far as sync'ing the audio to the animation when using the tracker bar and jumping around? I'll basically be mathematically slicing the bar graphic into pieces and using that to tell the animation what frame to start on, and converting that to a time for the audio to start. Will this work? Thanks, still figuring AS3 out as I go here!

How Can I Track The Amount Of Bytes Loaded (more Accurately)?
I want to use the MovieClip.loadMovie() method to load an external .swf file into my flash 5 movie.

The external file is just a jpeg that I've exported from fireworks as a .swf. It's 100kb.

Now, as the .swf file loads, I want to monitor how many bytes have loaded. I want to do this as accurately as possible because I like to let my users know how long they have to wait.

Seems reasonable, right? Wrong. I have read in Colin Moock's 'Actionscript- the Definitive Guide' that: "getbytesloaded() measures bytes in whole-frame chunks only. So if a movie's first frame is 200 bytes in size and its second frame is 3000 bytes in size, getbytesloaded() will return 200 and 3200 but never any increment in between".

So, assuming that my jpeg/swf file has all 100kb in one frame, I'm probably going to have a very long night trying to devise an accurate preloader movie.

Still, I reckon that if there's a will, there's a way. Can anyone point this newbie in the right direction? Thanks.

Accurately Detecting Webcam/microphone Presence
Does anyone have an accurate method to detect the presence of webcam and microphone?

The following methods are often mentioned, but very inaccurate.
* Camera.get() - will always be valid if you've a webcam driver installed.
* Camera.onStatus - code=="Camera.unmuted" only tells us when a user explicitly clicks on allow webcam/mic
* Check for valid FPS in the camera within a time frame. This works to a certain extent, but will need a timeout function.

Potential problems with above methods:
* Driver installed, but webcam not plugged in.
* Webcam plugged in, but in use by another application.
* Webcam ready, but user permanently disallow use of webcam

Anyone has a good robust way of checking for webcam/microphone availability? Any help will be greatly appreciated.

Trouble With Accurately Coloring Perlin Noise
Hi there, I'm having trouble with fine tuning the color of a perlin noise layer. The bitmap data parameters don't give you many color options so I thought I'd try using a colour matrix filter, but it's notoriously fiddly, and I wasted hours trying to get the colour I wanted to no avail. There has to be an easier way. Since I'm a newby I thought I'd put it out there and hope someone can help me. You'll see from the following code that I've tried to juggle the numbers in the color matrix filter, but I just can't seem to crack it. Too many options, perhaps. Anyway, if there's another method I'd appreciate it if anyone could help me. If you could be really specific about the syntax and assume I know very little, I'd appreciate it.

Thanks in advance.

Peter


Code:
import flash.display.BitmapData;
import flash.geom.Point;
import flash.filters.BitmapFilter;
import flash.filters.ColorMatrixFilter;

var myBitmapData:BitmapData = new BitmapData(Stage.width, Stage.height, false, 0xFFFFFF);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());

var randomNum:Number = Math.floor(Math.random()*10);

mc.attachBitmap(myBitmapData, this.getNextHighestDepth());

var point1:Point = new Point(0,0);
var point2:Point = new Point(50,10);
var perlinOffset:Array = [point1, point2];
mc.onEnterFrame = function () {
perlinOffset[0].x -= 20;
perlinOffset[1].y += 20;
myBitmapData.perlinNoise (600, 600, 1, randomNum, true, true, 4, false, perlinOffset);
}

mc.cacheAsBitmap = true;
var matrix:Array = new Array();
matrix = matrix.concat([0, 0 , 1, 0, 0]); // red
matrix = matrix.concat([1, 0, 0, 1, 0]); // green
matrix = matrix.concat([7, 6, 0, 0, 0]); // blue
matrix = matrix.concat([0, 0, 0, .75, 0]); // alpha
var filter:BitmapFilter = new ColorMatrixFilter(matrix);
mc.filters = new Array(filter);

Coding Buttons To Jump Scenes Accurately?
Thanks in advance for any help.

My issue is that my buttons only jump to the next scene on my scene palette when I use them, not to the scene that I need them to jump to. I'm awar that scenes aren't the best to use, but I am so deep into this thing, it won't do me any good to chenge everything now.

My code for each button is

Code:

on(release) {
   gotoAndPlay("scene2, frame1");
}

I am coding the actual buttons, not an actionScript layer like I often see (I'll get there eventually).

Anyway, the button only actives the scene that is selected, even when they are coded to different scenes.

Or when I preview the file, when pressing on other buttons besides the original, it simply jumps to the next scene in my scene palette, not the scene corresponding to the actionScript.

Any help would be really appreciated, thanks.

It Is Impossible To Accurately Test For A User's Player Version
OK - after two days of experimenting, trial and error, all sorts of actionscripts, etc, I've come to a conclusion.

There is no foolproof, works-every-time way to test for a users Flash player version using just actionscript.

Prove me wrong - I would love it. But I am almost positive that it cannot be done without including some external JAVAScript.

Preloader Not Accurately Preloading...huge Lag Time While Browser Tries To Load
i'm using a preloader that I have used many times before...and has always worked. However for some reason, it's not workng properly now. When i load the url in my browser, I get a completely black screen (blk is my background color) for quite some time, until eventually my preloader pops up for a second and then the main part of my movie appears. (then loads in 1st external swf with home page content).
I assume that the long lag time i am seeing is the time it takes for the file to load into the browser....isn't that what a preloader is for?? So at least there is some indication of what you are waiting for?
One last thing: my main swf file is HUGE!! I can't seem to figure out why. My swf is 2.4 MB. MY SWF!!!! the FLA is 5.4 MB. To me...that seems rather large, and there really is nothing to make it that big. I use external swf's for my content to keep file size down....i don't get it....
Can I get a little help from someone...anyone.... please?
thanks in advance....

Here is the code from my preloader scene, from here it goes to Scene 1. My preloader is 3 frames, my main movie (Scene 1) is one frame. I'm working in MX2004Pro on a G5:

Frame 1.)
code: fscommand("fullscreen", "false");
play();
//////////// 1st Sound /////////////
transForm = new Sound();
transForm.attachSound("transSound");
transFormVolume = 75;
transForm.setVolume(transFormVolume);
///////////// 2nd Sound ///////////
staticTV = new Sound();
staticTV.attachSound("static01");
staticTVVolume = 50;
staticTV.setVolume(staticTVVolume);
///////////// 3rd Sound ///////////
laser = new Sound();
laser.attachSound("laser01");
laserVolume = 50;
laser.setVolume(laserVolume);

Frame 2.)
code:
// percent_display is the name of dynamic text box showing percentage of movie loaded
percent_display = (int((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"% loaded . . .");
// Check to see if the movie is loaded.
if (_root.getBytesLoaded() != _root.getBytesTotal()) {
// If not, loop to the previous frame.
prevFrame();
} else {
// If loaded, play movie
play();
}

Frame 3.)
code: stop();
gotoAndPlay("Scene 1");

My Progress Bar mc has this script inside it's 2 frames:
code:
// in frame 1
setProperty(this, _xscale, (_root.getBytesLoaded()/_root.getBytesTotal())*100);
play();

// in frame 2
prevFrame();

Frame Independent Circle To Circle Detection
I am having trouble trying to get my head round this part of programming.
I know it is used for detection between movieclips such as snooker balls. I just cant get my head around it and it is driving me nuts!
Does anyone know of any good tutorials that I can use to solve this problem?

Thanks

The Toffee

Circle Collision Plus Direction Circle Should Go
I need help (or code) on how to figure out the direction a circle should go after it is hit by another circle. I know how to get the circles to know when they hace hit each other but i need to know how to find the angle at which the circle would bounce off at. Thanks to anyone who can help.

Moving A Circle Over Half A Circle
how do i move over the half circle
up and donw the circle line?
how do i move it to a certain point?
and how do i calculate it for example 5 point that will be in equal spaces between the circles?
thnaks in advance
peleg

Circle-circle Reactions, With A Twist..?
All right, I'm not as dumb as I sound -- no, really! But here's what's got me stumped:

I have a series of circles that gradually spin toward the center of the screen. The circles are randomly placed at the outer edge of the screen and randomly assigned a speed. Because the balls don't travel in a linear fashion, I'm having trouble figuring out how to adjust their movement. As the circles get closer to the center, they also get "spun" a certain amount -- they have a property called "theta" that gets appended with another property called "spin." Anyway...

I can detect when a collision is taking place: I'm just completely blank regarding how to make the circles react. I've searched a bunch of places, but nothing I've found is making any sense to me...and I'd like to think that I'm not brain-dead...

If anyone has any suggestions, I would LOVE to hear them! Thanks in advance!

Regards,
Blake

Moveable Circle Around Another Circle - No Overlap
Hey all. I have two MC's, circular in shape. One of the circles is stationary and you can drag the other. I'm trying to get the moveable circle to be able to move around the circumference of the stationary circle, but not overlap. I'm able to detect when they overlap, not using hittest. I just can't figure out how to code it so that the draggable circle can't be moved over the stationary circle. Any suggestions, comments, or help is greatly appreciated. Thx.

Drawing A Animated Circle, Dot To Circle
Can some one help me??

Im new in Flash, I want to make an animation of a circle, begining from a small dot and ending in a circle (like wen we draw in a paper), I allready tried everything I know (not a lot!!!! ) .

Is it possible to make this? I will trie to explain:

I want to make a animation of a small pencil drawing a circle from nothing. Begining with the pencil drawing a dot then that pencil will make the complete circle like wen we draw in a paper by hand.

Sorry my English is not very good.

Please Help!

Arcanjo

Circle-Circle Detection
I need some serious circle to circle collision detection. I used one from jobe makar, but I don't think it works for circles that are'nt both moving. Some of the variables are 0, so when it divides by them, it returns NaN. Anybody know any collision detection scripts? <--Sorry, I just wanted to put that in there

Circle Vs. Circle Ricochet.
I'm working on a game that involves circle vs. circle collision detection (More specifically moving circle vs. static point). I am able to project the circle out of the point but I have no Idea how the change the velocity of the circle so that it is physically accurate.

I whipped up a quick thing to Isolate the circle vs. point collision here.

Here's the script:


Code:
var GRAV:Number = .22;
var RADIUS:Number = ball.width/2;
var vx:Number = 0;
var vy:Number = 0;
var dx:Number = 0;
var dy:Number = 0;

stage.addEventListener(Event.ENTER_FRAME, enterFrame);

function enterFrame(Evnt:Event):void {

ball.x += vx;
ball.y += vy;
vy += GRAV;
dx = ball.x - dot.x;
dy = ball.y - dot.y;
if (Math.sqrt(dx*dx+dy*dy)<RADIUS) {
ball.x = dot.x+dx*RADIUS/Math.sqrt(dx*dx+dy*dy);
ball.y = dot.y+dy*RADIUS/Math.sqrt(dx*dx+dy*dy);
// I have no Idea what to put here to simulate ricochet
}


}
If anybody could tell me how I would manipulate the vx and vy variables that would be grand.

Help With Circles
imagine a circle of dots.

and when i move my mouse left the circle rotates anti clock wise and when right it goes clockwise (obviously the further from the center -the faster the rotation.)

how can i achieve this in actionscript??

Can You Do This With Circles
hello ....

hello to lexicon...
is there anyway to do this effect but with circles??????

// create mc that will contain all the squares
mask = _root.createEmptyMovieClip("maskMC",1);
// square size
size = 20;
// init
c=0;
r=0;
// wait however long before squares disapear (in frames)
stallFor=20;

for (i=0; i<560; i++){
// create square mc
mc = mask.createEmptyMovieClip("mc"+i,i);
// draw the square
mc.lineStyle(1,0x000000,0);
mc.beginFill(0x999999,100);
mc.moveTo(0,0);
mc.lineTo(0,size);
mc.lineTo(size,size);
mc.lineTo(size,0);
mc.lineTo(0,0);
mc.endFill();

// position the square
mc._x = r * size;
mc._y = c * size;

// set random properties for movement scaling etc
mc.delay = stallFor + r;
mc.rot = random(20) - 10;
mc.scaler = random(6)+6;
mc.mvx = random(5)+2;
mc.mvy = random(20)-10;

// set on enterframe function for the square
mc.onEnterFrame = function(){
if (!this.delay) {
// do movements
this._rotation += this.rot;
this._xscale = this._yscale -= this.scaler;
this._x -= this.mvx;
this._y -= this.mvy;
if (this._xscale < 0) {
// remove it when we are finished with it
this.removeMovieClip();
} else {
this._alpha-=this.scaler/2;
}
} else {
this.delay--;
}
}
// sort out position in grid
if( c<19 ){
c++;
}else{
c=0;
r++;
}
}

Fun With Circles
Hi there,

I'm seeking some circle related help.

What goes on in my code is like this.

1) I define a number of segments that I want my circle have (8 for example)

2) Every time that I dispatch a "fill" event I want 1 of the segments to fill a color. but when I reach 8 I want the graphics to be cleared and start filling from the 1st segment again.

So it goes 1,2,3,4,5,6,7,8 CLEAR 1,2,3,4,5,6,7,8 CLEAR and so on.

The Problem I have is that "1" never gets filled because of the Clearing.

I need help understanding how to approach this



ActionScript Code:
package
{
   
    /**
    * ...
    * @author DefaultUser (Tools -> Custom Arguments...)
    */
   
    import flash.display.DisplayObjectContainer;
    import flash.display.Graphics;
    import flash.display.MovieClip;
    import flash.display.Shape;
    import flash.filters.*
    import caurina.transitions.*;
    import flash.utils.Timer;
    import org.flashdevelop.utils.xtrace
    import flash.events.TimerEvent
    import flash.text.TextField

    public class LoopProgress extends MovieClip
    {
       
        private var nbR1:Number = 30;
        private var nbR2:Number = 40;
        private var nbC1:Number = 0xABACFE;
        private var nbC2:Number = 0xCDCEFE;
        private var nbArcs:Number = 8;
        private var nbSpace:Number = 0.3;
        private var nbSector:Number = 0;
        private var actArc:Number = 0;
        private var lastArc:Number = 0;
       
        private var angle:Number = 360 / nbArcs;
       
        private var percent:Number = 0;
       
        private var glow:GlowFilter = new GlowFilter(nbC2, 0.5, 10, 10, 2, 3);
       
        private var _bgShape:Shape = new Shape()
       
        private var bgGraphics:Graphics;
       
        private var holder:MovieClip = new MovieClip()
       
        private var bg:MovieClip = new MovieClip();
       
        private var sectors:MovieClip = new MovieClip();
       
        public var snapValue:int;
       
        public var isSnap:Boolean = false
       
        public var _text:TextField = new TextField();
       
       
        public function LoopProgress(pSegments:Number) //pSegments = 8
        {
           
            nbArcs = pSegments;
           
            angle = 360 / nbArcs;
           
            sectors.filters=[glow]
           
            bg.alpha = .5
           
            holder.addChild(bg)
           
            holder.addChild(sectors) // sectors is the MC I fill
           
            this.addChild(holder)
           
            drawBackGround()
        }
       
        private function drawBackGround():void
        {
           
           
            for (var i:Number = 0; i < nbArcs; i++)
           
            {
               
                   
                   
                    bg.addChild(_text)
                   
                    drawSector(bg,i*angle,angle*(1-nbSpace),nbR1,nbR2,0xFF00FF)
                   
                   

            }
           
           
        }
       
        // --->>  FUNCTION TO DRAW THE SEGMENTS
       
        // This function gets called at interval i have set else where in my code
       
        private function drawSector(mc:MovieClip, startAngle:Number, arc:Number, r1:Number, r2:Number, color:Number):void
        {
               
                mc.graphics.lineStyle(1,0x6688AA,.5)
                mc.graphics.beginFill(color, 100);

                var segAngle:Number;
                var theta:Number
                var angle:Number
                var angleMid:Number    
                var segs:Number 
                var ax:Number
                var ay:Number
                var bx:Number
                var by:Number
                var cx:Number
                var cy:Number
               
            //  startAngle=startAngle
               
               
                if (Math.abs(arc)>360) {
                    arc = 360;
                }
               
                segs = Math.ceil(Math.abs(arc)/45);

                segAngle = arc / segs;
               
                theta = -(segAngle / 180) * Math.PI;
               
                angle = -(startAngle / 180) * Math.PI;
               
                if (segs>0) {
                    ax = 0+Math.cos(startAngle/180*Math.PI);
                    ay = 0+Math.sin(-startAngle/180*Math.PI);

                    mc.graphics.moveTo(ax*r1, ay*r1);
                    mc.graphics.lineTo(ax*r2, ay*r2);
                   
                    for (var i:uint = 0; i < segs; i++) {
                       
                        angle += theta;
                   
                        angleMid = angle-(theta/2);
                        bx = Math.cos(angle)*r2;
                        by = Math.sin(angle)*r2;
                        cx = Math.cos(angleMid)*(r2/Math.cos(theta/2));
                        cy = Math.sin(angleMid)*(r2/Math.cos(theta/2));
                        mc.graphics.curveTo(cx, cy, bx, by);
                    }
                   
                    ax = 0+Math.cos((startAngle+arc)/180*Math.PI);
                    ay = 0+Math.sin(-(startAngle+arc)/180*Math.PI);
                   
                    mc.graphics.lineTo(ax*r1, ay*r1);
                   
                    for (var j:uint = 0; j<segs; j++) {
                        angle -= theta;
                        angleMid = angle+(theta/2);
                        bx = Math.cos(angle)*r1;
                        by = Math.sin(angle)*r1;
                        cx = Math.cos(angleMid)*(r1/Math.cos(theta/2));
                        cy = Math.sin(angleMid)*(r1/Math.cos(theta/2));
                        mc.graphics.curveTo(cx, cy, bx, by);
                    }
               
                    mc.graphics.endFill();
                }
               
               
                // here is where I clear my sectors but cause sector 1 not to fill
               
                if (isSnap)
                {
                    isSnap = false;
                   
                   
                    sectors.graphics.clear()
                   
               
                   
                }
               
               
        };
       
        public function fillSegments(pBeat:Number):void
        {
           
            xtrace("beat in loop anim " + pBeat)
           
            _text.text=new String(pBeat)
           
            var actArc:Number = pBeat-1;
           
            if (pBeat == 1)
            {
                drawSector(sectors, pBeat*angle, angle*(1-nbSpace), nbR1, nbR2, 0x00ff00);
               
            }else
            {
                drawSector(sectors, pBeat*angle, angle*(1-nbSpace), nbR1, nbR2, nbC1);
               
            }
           
            lastArc = actArc;
           
           
           

           
        }
       
       
       
        public function setSnap(pNum:Number):void
        {
       
            this.isSnap=true
           
        }
       

       
    }
   
}

thanks,

dub

Circles.....
boy..flash IS addictive.


I read the tutorial for motion guides and it is relatively simple using a pencil. now what if i want to guide to be a perfect circle? Take a look at this,

www.skillfish.com/circle.gif

How can i get the little circle to rotate around the big circle? ( with the big circle not visible)

thanks!

Collision With Circles
Doh, someone told me the other day how to detect a collision with circles, without using hittest (coz that's shockingly bad with anything un-rectangle-like), but I lost the answer!
Could someone please tell it to me again,its just one line of code , pythagoras theory on radius if I remember correctly. Cheers all
--------------------
The monsters are coming...

Circles Stumping Me
Hi All,

Not a complete newb to flash, but it's been a lil while since I've used it. Please check this. Everything in blue is for reference. What I'm trying to have happen it for the rings to "grow" in a circular motion, the inner and outer one counterclockwise, the middle one clockwise. I'm breaking me poor brain trying to figure out how to do this, any suggestions?

Thanks, Amethyst

Making 90 Circles
i need to make 90 concentric circles, it will represent a globe,0-90 degrees, the circles need to have the same distance between each other (1 degree), ive tried doing it by making a circle then copy and pasting it and making it bigger but its a right pain and i cant get the gaps the same, can anyone suggest another way?

Round In Circles
One that has been covered a million times I imagine, but can't seem to find a simple solution.

All i'm looking to do is find a way that any browser accomodates to fit my SWF file without any space around. The size I'm working from 640X380. I've tried many ways that make my movie flush to the top left and right but always have a gaping space dependent on browser bottom of page and right.
www.hip-replacement.com

Just want it to appear as If i'd opened it via a SWF player.

Please help, thanks, Lee

Concentric Circles
Anyone built concentric circles, which ripple out when something falls into water? Got any animations to share or tips on how to do it?

Circles Logo With AS?
Anyone I need some help I have been on that for long...

I would like to have my logo with the circles filled randomly how can I do that ?

I have found a post telling that I should create all my circles as a movie clip and try to generate a random number that would select the circles and another random number to to change the alpha.

the circle could be adressed with the setProperty action

Any code around?

Thanks

xav

Cant Get Get Circles Move
I have made five circles and I want them to move at
along x axis. I want to use action script heres the script. None of them are moving. I have given them instances name from circle1-circle5. I copied the the MC and pasted them. I have included the FLA file.


for (i=1; i<=5; i++)
{
_root["circle"+i]._x++;
}

Rotating Circles...can Anyone Help?
I am wanting to have a small circle rotating around a large circle as though it were a moon around a planet. I also want the large cicle to move and the small circle to follow and continue to rotate as though it were parented to it....can anyone help please???

Circles On A 3D Plane?
Hi,
is it possible to code circles on a 3D plane animated like this DivX video ?

I managed to build it using motion tween resulting in a 122k swf file. 12k would be more appropriate.

I also tried to code myself based on this 3D Math and other articles, but it would take by far too much time.

Any help is much appreciated

David

Circles That Dissapear
I got to do this thing 4 school and I thought while looking through tutorials it would be better to have so advice from experienced users.

Basically I have a matrix of circles and I have to make them disappear randomly.

I'm an experienced flash user but just didn't need to use as3 on this level before.

Any input would be appreciated.

Cheers

[CS3] Circles That Disappear AS3 To AS2
Hey, guys.

Neznein9, helped me out with a project I had to do in AS3, now I need it in AS2 as well. He recomended posting for help for here as well. I've tried something myself but it doesn't do anything at all..no errors..but no nothing.

This is the AS3 of the problem that Neznein helped me solve:
PS: there are some small differences (names or some calculated stuff)


PHP Code:



//  create a place to hold the circles
const CIRCLES:Array = [];

const ROWS:int = 25;
const COLS:int = 40;
const MAX_CIRCLES:int = ROWS * COLS; // 1000

const LEFT_PADDING:int = 146;    //  offset from left edge
const TOP_PADDING:int = 67;        //  offset from top edge
const H_SPACING:int = 8;        //  circle spacing
const V_SPACING:int = 8;

var _timeMark:Number = getTimer()-1;

var _visibleCircles:Array;        //  circles available for killing
var _activelyKilling:Boolean = false;    //  current status

init();

function init():void{
    var i:int = MAX_CIRCLES;
    var c:Shape;

    while(i){
        i--;
        
        //  create a new circle
        c = new Shape();        
        c.graphics.beginFill(0xFF0000);
        c.graphics.lineStyle(0, 0xFF0000);
        c.graphics.drawCircle(0, 0, 2.5);

        //  set x,y position
        c.x = (i % COLS) * H_SPACING + LEFT_PADDING;
        c.y = int(i / COLS) * V_SPACING + TOP_PADDING;

        //  add a new circle
        CIRCLES.push( addChild(c) );        
    }
    
    //  add all circles to the killable list
    _visibleCircles = CIRCLES.concat();
}

function reset(e:Event = null):void{
    txt_t.text=String(0);
    txt_dez.text=String(0);
    txt_ne.text=String(1000)
    //  turn them all visible again
    for each(var c:Shape in CIRCLES){ c.visible = true; }
    //  refresh killable list
    _visibleCircles = CIRCLES.concat();
    //  restart the clock
    _timeMark = getTimer();
    
}

function destroyRandCircle(e:Event = null):void{
    //  pick a random circle from the killable list
    var indexToKill:int = int(Math.random() * _visibleCircles.length);

    //  turn it invisible
    _visibleCircles[indexToKill].visible = false;

    //  strike it from the list
    _visibleCircles.splice(indexToKill, 1);

    //  report current status
  //  trace('[' + ((getTimer() - _timeMark) / 1000) + ' seconds] :: REMAINING ' + _visibleCircles.length + " / " + (CIRCLES.length - _visibleCircles.length + ' REMOVED'));

    txt_t.text=String((CIRCLES.length -_visibleCircles.length) / 100);
    txt_dez.text=String(_visibleCircles.length);
    txt_ne.text=String(CIRCLES.length - _visibleCircles.length);
    
    
    //  account for overkill
   // if(_visibleCircles.length == 0) reset();
   if(_visibleCircles.length == 0) pauseKilling();
}

function startKilling(e:Event = null):void{
    pauseKilling();
    if(!_activelyKilling){
        addEventListener(Event.ENTER_FRAME, destroyRandCircle);
        _activelyKilling = true;
    }
    else{removeEventListener(Event.ENTER_FRAME, destroyRandCircle);
}
}

function pauseKilling(e:Event = null):void{
    if(_activelyKilling){
        _activelyKilling = false;
        removeEventListener(Event.ENTER_FRAME, destroyRandCircle);
    }
}

rewind_btn.addEventListener(MouseEvent.CLICK, reset);
pause_btn.addEventListener(MouseEvent.CLICK, pauseKilling);
start_btn.addEventListener(MouseEvent.CLICK, startKilling);





This is what I've tried so far:


PHP Code:



CIRCLES =new Array();
ROWS = 25;
COLS = 40;
MAX_CIRCLES = ROWS * COLS;

LEFT_PADDING = 146;  
TOP_PADDING = 67;      
H_SPACING = 8;  
V_SPACING = 8;

var _visibleCircles:Array=new Array();
var _activelyKilling:Boolean = new Boolean(false);

init();

function init(){
    var i = MAX_CIRCLES;
    var c = Shape;

    while(i){
        i--;
     
        c = new Shape();        
        c.graphics.beginFill(0xFF0000);
        c.graphics.lineStyle(0, 0xFF0000);
        c.graphics.drawCircle(0, 0, 2.5);
        c.x = (i % COLS) * H_SPACING + LEFT_PADDING;
        c.y = int(i / COLS) * V_SPACING + TOP_PADDING;
        CIRCLES.push( addChild(c) );        
    }
    _visibleCircles = CIRCLES.concat();
}



function reset1(){
    pauseKilling();
    txt_t.text=String(0);
    txt_dez.text=String(0);
    txt_ne.text=String(1000);
var i = CIRCLES._length;

while(i){
    i--;   
    CIRCLES[i]._visible = true;
}
    _visibleCircles = CIRCLES.concat();
    }


function killRandomCircle(){
    var indexToKill = int(Math.random() * _visibleCircles.length);
    _visibleCircles[indexToKill].visible = false;
    _visibleCircles.splice(indexToKill, 1);    
    txt_t.text=String((CIRCLES.length -_visibleCircles.length) / 100);
    txt_dez.text=String(_visibleCircles.length);
    txt_ne.text=String(CIRCLES.length - _visibleCircles.length);
   if(_visibleCircles.length == 0) pauseKilling();
}

function startKilling(){
    if(!_activelyKilling){
        addEventListener(Event.ENTER_FRAME, killRandomCircle);
        _activelyKilling = true;
    }
    else{removeEventListener(Event.ENTER_FRAME, killRandomCircle);}
}

function pauseKilling(){
    if(_activelyKilling){
        _activelyKilling = false;
        removeEventListener(Event.ENTER_FRAME, killRandomCircle);
    }
}

this.rewind_btn.onRelease = reset1();
this.pause_btn.onRelease = pauseKilling();
this.start_btn.onRelease = startKilling();




Thank you for your time and thank you again Neznein9.

LE: Solved, check thread with same name in action script 3 help

Perfect Circles?
In the Flash IDE, is it possible to draw perfect (or at least better than the circle tool) circles? I ask because I'm applying math-based physics to an arc and it doesn't quite match up to the visuals in the background.

Hit Test With Circles
I am making a simple maze game, where the object is the drag a ball out of the center to the outside of the maze. The maze is round, like this:


Each ring (wall of the maze) is a movie clip with hit test.
The problem is that when I touch the the invincible part of the mc, the hit test is activated. By the "invincible part of the mc" I mean the box around the ring shown here in red:



What can I do so that the hit test will only respond when I touch the visible part of the mc, show here in red:

Is It Possible To Select Circles ?
Is it possible to select circles instead of rectangle or using the lasso tool ?

I want to select circles from a bitmap to remove them from the center. But I can only select rectangles using the Arrow Selection Tool

Thanks

Question About Circles
I've got a game (I put it in the Site Check forum) and some issues with circular collision detection. Basically, I want to have it so the ball acts better when it touches the bricks in the game. The player is able to control the horizontal movement with the keyboard, but the vertical movement is automatic. Does anyone have any tutorials with something similar to this?

The game is here if you want to see: http://www.elevationdj.com/Diamonds.html

Random Circles
Hello-
I am trying to figure out how to make a random number of circles appear on a stage I have created and then have them scale x and y randomly and at different speeds as well. In other words, the circles would appear in random numbers, in random locations, at different speeds, and scale up or down in random sizes as well. The client has asked for circles to appear and disappear to symbolize "complete chaos". You can see a screenshot of the circles and image here:
www.malphurs.com/random.jpg

I have found plenty of tutorials on random actionscripts, but none that mix all of the above: random location, speed, and scaling.

Any help would be greatly appreciated.

My Circles Are Sticking...
http://subtlepen.danwa.net/stuffs/circleBounce.html
How do I get the circles to bounce off of each other?

100 Moving Circles
can i do this in flash? which is the best way to do it? i have a main mc and i want to duplicate it and then move it in specific area..

thank you for your time

Magnetic Circles
Hi everbody,

I've got an idea and need your opinion and evaluation about it. Maybe even some suggestions about the way to do it.

I want to create randomly sized circles which act magnetically to eachother. They should start on random positions and then find the perfect order. They shouldn't overlap.

What are the things I have to deal with here? Any advice on what I should read/learn? Any links to something similar?



Thanx alot!!

Copyright © 2005-08 www.BigResource.com, All rights reserved