Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Coding a circular preloader
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 27 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Omar Fouad  
View profile  
 More options Aug 6 2007, 5:23 am
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Mon, 6 Aug 2007 12:23:58 +0300
Local: Mon, Aug 6 2007 5:23 am
Subject: [Flashcoders] Coding a circular preloader
Folks i was just wondering how to create a circular preloader with
actionscript. I thought about drawing many wedges increasing each time the
angle accodring the percentage loaded, but how can i include an easing
effect to this rotating motion?

Regards....

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ivan Dembicki  
View profile  
 More options Aug 6 2007, 6:37 am
From: "Ivan Dembicki" <ivan.dembi...@gmail.com>
Date: Mon, 6 Aug 2007 14:37:17 +0400
Local: Mon, Aug 6 2007 6:37 am
Subject: Re: [Flashcoders] Coding a circular preloader
Hello Omar,

try this:
http://proto.layer51.com/d.aspx?f=388

--
iv
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Omar Fouad  
View profile  
 More options Aug 6 2007, 6:49 am
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Mon, 6 Aug 2007 13:49:29 +0300
Local: Mon, Aug 6 2007 6:49 am
Subject: Re: [Flashcoders] Coding a circular preloader
Woah!!! too complicated...

On 8/6/07, Ivan Dembicki <ivan.dembi...@gmail.com> wrote:

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Omar Fouad  
View profile  
 More options Aug 6 2007, 7:06 am
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Mon, 6 Aug 2007 14:06:36 +0300
Local: Mon, Aug 6 2007 7:06 am
Subject: Re: [Flashcoders] Coding a circular preloader
that example is not working.,.

On 8/6/07, Omar Fouad <omarfouad....@gmail.com> wrote:

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ivan Dembicki  
View profile  
 More options Aug 6 2007, 7:23 am
From: "Ivan Dembicki" <ivan.dembi...@gmail.com>
Date: Mon, 6 Aug 2007 15:23:25 +0400
Local: Mon, Aug 6 2007 7:23 am
Subject: Re: [Flashcoders] Coding a circular preloader
Hello Omar,

possible... it's very old example.
try at this:

function drawSegment(target, rx, ry, x, y, sgm, s1, s2) {
        var rad = Math.PI/180;
        if (!s1 and !s2 or s1 == s2) {
                var grad = 360;
                var segm = grad/sgm;
                var x1 = rx+x;
                var y1 = y;
                target.moveTo(x1, y1);
        } else {
                s1>s2 ? s1 -= 360 : "";
                var x1 = rx*Math.cos(s1*rad)+x;
                var y1 = ry*Math.sin(s1*rad)+y;
                var grad = s2-s1;
                var segm = grad/sgm;
                target.moveTo(x, y);
                target.lineTo(x1, y1);
        }
        for (var s = segm+s1; s<(grad+.1+s1); s += segm) {
                var x2 = rx*Math.cos((s-segm/2)*rad)+x;
                var y2 = ry*Math.sin((s-segm/2)*rad)+y;
                var x3 = rx*Math.cos(s*rad)+x;
                var y3 = ry*Math.sin(s*rad)+y;
                // begin tnx 2 Robert Penner
                var cx = 2*x2-.5*(x1+x3);
                var cy = 2*y2-.5*(y1+y3);
                target.curveTo(cx, cy, x3, y3);
                // end tnx 2 Robert Penner :)
                x1 = x3;
                y1 = y3;
        }
        if (grad != 360) {
                target.lineTo(x, y);
        }

};

_root.onEnterFrame = function() {
        _root.clear();
        _root.lineStyle(0);
        _root.beginFill(0xFF0000);
        a= a||0
        b=b||0
        a>=360 ? a -= 360 : a += 2;
        b>=360 ? b -= 360 : b += 3;
        drawSegment(_root, 150, 100, 200, 250, 8, a, b);
        _root.endFill();
        _root.lineStyle(0);
        _root.beginFill(0xFF00FF);
        drawSegment(_root, 150, 100, 200, 200, 8, a, b);
        _root.endFill();

};

--
iv
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "oscillations" by Andreas R
Andreas R  
View profile  
 More options Aug 6 2007, 9:06 am
From: Andreas R <andreas.ronn...@rayon.no>
Date: Mon, 06 Aug 2007 15:06:14 +0200
Local: Mon, Aug 6 2007 9:06 am
Subject: [Flashcoders] oscillations
Out of curiosity, what are the "right" ways to calculate oscillations
like triangle, sawtooth and pulse? Ideally oscillation would work in
parallel with sine, so when sin=1, triangle=1, taking radians as the
frequency parameter.

Any takers?

- Andreas R
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Coding a circular preloader" by Omar Fouad
Omar Fouad  
View profile  
 More options Aug 6 2007, 11:18 am
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Mon, 6 Aug 2007 18:18:15 +0300
Local: Mon, Aug 6 2007 11:18 am
Subject: Re: [Flashcoders] Coding a circular preloader
ok i got something better and faster.

I downloaded some methods from
http://www.adobe.com/devnet/flash/articles/adv_draw_methods.html.
in this library there is an .as file wich lets u draw wedges easily (
drawWedges.as) but infortunately it doesnt support easing yet..

I am trying to add an easeOut effect to it, and i tried this way....

#include "drawWedge.as"
d_mc = _root.createEmptyMovieClip("drawing_layer",1);

angle=0
function wedge() {
    this.onEnterFrame = function () {

        newAngle = angle++

        d_mc.clear();
        d_mc.beginFill(0xFF0067, 100);
        d_mc.drawWedge(200, 200, 90, newAngle, 100);
        d_mc.endFill();

        if(newAngle >=100) {
            delete this.onEnterFrame;
        }
    }

};

wedge();

this way the wedge grows until the angle reaches 100. how can I add a
simple  easing equation to this?

I always used  mcTween and  for some loadbar preloader i  used to ease the
loadbar by adding

loadBar._xscale +=percent - loadBar._xscale/3; /// this way the loadBar
tweens with an easeOut Effect..
I tried to apply the same principle to the wedge but without results..

Any ideas?

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Accordion-Labels problem..." by Cristo @ Cryzto.ch
Cristo @ Cryzto.ch  
View profile  
 More options Aug 6 2007, 12:01 pm
From: "Cristo @ Cryzto.ch" <cry...@cryzto.ch>
Date: Mon, 6 Aug 2007 18:01:08 +0200
Local: Mon, Aug 6 2007 12:01 pm
Subject: [Flashcoders] Accordion-Labels problem...
Hi Folks!

I've made a little example where I've got two Accordion- and 3
Button-Instances.

First I load two XMLs, one for each Accordion [navi_acc and model_acc].

When I push the 1.Button [models_btn], the 1. Accordion shows up [navi_acc].

Then when I push on one navi_acc-Element, the 2. Accordion shows up
[model_acc].

Now I've got two language-Buttons [German & English]. When I push on one of
these Buttons, each Accordion-Element is updated to the selected Lang.

The problem is: it works, the model_btn.label, all Button-Labels inside the
Accordions.but..

The labels of the Accordion-headers don't change."visually".but if I make a
trace of the labels'n names, they are!

You can see my example @  <http://www.cryzto.ch/index2.html>
www.cryzto.ch/index2.html !

Can someone helpme?

cryzto

  _____  

Ich verwende die kostenlose Version von SPAMfighter,
die bei mir bis jetzt 1614 Spammails entfernt hat.
Fur private Anwender ist SPAMfighter vollig kostenlos!
Jetzt gratis testen: hier klicken <http://www.spamfighter.com/lde> .
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Coding a circular preloader" by Palmer, Jim
Palmer, Jim  
View profile  
 More options Aug 6 2007, 12:09 pm
From: "Palmer, Jim" <jpal...@mammoth-mtn.com>
Date: Mon, 6 Aug 2007 09:09:25 -0700
Local: Mon, Aug 6 2007 12:09 pm
Subject: RE: [Flashcoders] Coding a circular preloader

Just another bit of actionscript butchery here for a circular preloader that I use all over the place in my apps and pages...

http://www.overset.com/2006/09/27/flash-wait-animation-ie-browser-thr...

--
Jim Palmer ! Mammoth Web Operations

_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Walton  
View profile  
 More options Aug 6 2007, 12:30 pm
From: "Eric Walton" <ericwalton9ed...@gmail.com>
Date: Mon, 6 Aug 2007 12:30:38 -0400
Local: Mon, Aug 6 2007 12:30 pm
Subject: Re: [Flashcoders] Coding a circular preloader
you could try this.

http://www.flashkit.com/movies/Animations/Vector_Animations/People/Da...

On 8/6/07, Omar Fouad <omarfouad....@gmail.com> wrote:

--
Eric Walton 9 / Edub9

To view more about
The Artwork of Eric Walton 9 / Edub9
please visit the following:
www.hollywoodfineart.com
www.myspace.com/ericwalton9_edub9
Providentia Marketing LLC
754-246-7620 Cel
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Omar Fouad  
View profile  
 More options Aug 6 2007, 1:10 pm
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Mon, 6 Aug 2007 20:10:40 +0300
Local: Mon, Aug 6 2007 1:10 pm
Subject: Re: [Flashcoders] Coding a circular preloader
Eric and Palmers thanks so much, i found something interesting here..
http://www.styluscanada.com/

Note the white preloader.. This is what i am talking about exactly...

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven Sacks  
View profile  
 More options Aug 6 2007, 1:27 pm
From: Steven Sacks <flash...@stevensacks.net>
Date: Mon, 06 Aug 2007 10:27:38 -0700
Local: Mon, Aug 6 2007 1:27 pm
Subject: Re: [Flashcoders] Coding a circular preloader
I jumped on this thread late, but it seems to me that the best/easiest
way to accomplish that circular preloader like you saw on that
photography site is with a 100 frame movieclip that contains a mask that
goes from frame 1-100 revealing a circle underneath.  It would probably
take you all of 5 minutes to make.

Sometimes the simplest solution is the best solution.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Omar Fouad  
View profile  
 More options Aug 6 2007, 1:42 pm
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Mon, 6 Aug 2007 20:42:26 +0300
Local: Mon, Aug 6 2007 1:42 pm
Subject: Re: [Flashcoders] Coding a circular preloader
This way no there would be no easing... And ma boss say he wants it with
actionscript *GRRRRR^

On 8/6/07, Steven Sacks <flash...@stevensacks.net> wrote:

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven Sacks  
View profile  
 More options Aug 6 2007, 2:38 pm
From: Steven Sacks <flash...@stevensacks.net>
Date: Mon, 06 Aug 2007 11:38:25 -0700
Local: Mon, Aug 6 2007 2:38 pm
Subject: Re: [Flashcoders] Coding a circular preloader
Easing?  You're showing linear data.  A visual representation of a
number from 0-100.  I'm not sure how easing fits into this.

Your boss sounds like a real genius because it's absolutely brilliant to
force somebody to spend many hours building something that could be
built in 5 minutes - really smart use of time and money.  He should
write a book on how to be successful in business.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "oscillations" by Glen Pike
Glen Pike  
View profile  
 More options Aug 6 2007, 4:22 pm
From: Glen Pike <postmas...@glenpike.co.uk>
Date: Mon, 06 Aug 2007 21:22:57 +0100
Local: Mon, Aug 6 2007 4:22 pm
Subject: Re: [Flashcoders] oscillations
Hi,

    There are not really any right ways - just the fastest way to get
stuff out...

    http://www.flashbrighton.org/wordpress/?p=9

    http://www.flashbrighton.org/wordpress/?p=6

    Can't find the drum machine article - they built one as part of a
contest with Flash Coders NY - source code here - check out the
ToneGenerator and the specific SawGenerator etc.

    http://svn1.cvsdude.com/osflash/drummachine/PCMAudioLibrary/

    Andre-Michelle has done some nice stuff, but not much source.

    http://lab.andre-michelle.com/

    These are probably okay for simple "one" off sounds, but if you are
building complex waveforms - e.g. adding lots of waves together at a
certain frequency, you may be better off building a wavetable then
reading sample values by interpolating - simple weighted addition of 2
samples indexed from an array.  If you want some C++ code, then I can
dig it out for you, but the PCMAudioLibrary looks adequate...

    You would have thought that FlashPlayer would have noise generators
built in for sound - they have them for images which have an extra
dimension, so are usually more processor intensive - c'mon Adobe, gimme
some audio tools already.

    Hope this helps.

    Glen

_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Coding a circular preloader" by David Ngo
David Ngo  
View profile  
 More options Aug 6 2007, 4:24 pm
From: "David Ngo" <da...@sentcreations.com>
Date: Mon, 6 Aug 2007 16:24:32 -0400
Local: Mon, Aug 6 2007 4:24 pm
Subject: RE: [Flashcoders] Coding a circular preloader
Uh, you could implement easing but I'm of the same opinion as Steve here
where it wouldn't make any sense to kill an ant with a sledgehammer. At any
rate, the easing would be based off a timer instead of frames. Pseudo code
AS2 using the Tween class would be:

var interval:Number = setInterval(this, 'showProgress', 100);

function showProgress():Void
{
        new Tween(scope, 'property', Easetype, currentVal, newVal, 0.1,
true);

}

You could change the interval and have the Tween's seconds be either equal
to or less than the interval.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Omar Fouad  
View profile  
 More options Aug 6 2007, 5:08 pm
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Tue, 7 Aug 2007 00:08:56 +0300
Local: Mon, Aug 6 2007 5:08 pm
Subject: Re: [Flashcoders] Coding a circular preloader
Hahaha Steven :D that was a good one ;). Thanks david.. but I don't have
it.. i'll try to convince my boss. But i would like to know the same how
that could be achieved like in the website.....

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Ngo  
View profile  
 More options Aug 6 2007, 7:24 pm
From: "David Ngo" <da...@sentcreations.com>
Date: Mon, 6 Aug 2007 19:24:06 -0400
Local: Mon, Aug 6 2007 7:24 pm
Subject: RE: [Flashcoders] Coding a circular preloader
I'm not sure what you mean. What don't you have? The pseudo code I posted is
fairly easy to implement. If you're using the drawing API to render your
circle or partial circle, just tap into the Tween class' onMotionChanged
event to update your vector shape.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse Graupmann  
View profile  
 More options Aug 6 2007, 7:24 pm
From: "Jesse Graupmann" <des...@jessegraupmann.com>
Date: Mon, 6 Aug 2007 16:24:24 -0700
Local: Mon, Aug 6 2007 7:24 pm
Subject: RE: [Flashcoders] Coding a circular preloader

Using the arc prototype ( AS 1/2 ) from formequalsfunction draw methods;
http://www.formequalsfunction.com/downloads/drawmethods.html and Tweener (
AS 2 ) from http://code.google.com/p/tweener/ I put together a simple tween
version of the circle.

Assuming you have Tweener in the same directory, you can copy and paste this
example.

- JG

/*-------------------------------------------------------------
        //
        //      http://www.formequalsfunction.com/downloads/drawmethods.html
        //
        mc.drawArc is a method for drawing regular and eliptical
        arc segments. This method replaces one I originally
        released to the Flash MX beta group titled arcTo and contains
        several optimizations based on input from the following
        people: Robert Penner, Eric Mueller and Michael Hurwicz.
-------------------------------------------------------------*/
MovieClip.prototype.drawArc = function(x, y, radius, arc, startAngle,
yRadius) {
        // ==============
        // mc.drawArc() - by Ric Ewing (r...@formequalsfunction.com) -
version 1.5 - 4.7.2002
        //
        // x, y = This must be the current pen position... other values will
look bad
        // radius = radius of Arc. If [optional] yRadius is defined, then r
is the x radius
        // arc = sweep of the arc. Negative values draw clockwise.
        // startAngle = starting angle in degrees.
        // yRadius = [optional] y radius of arc. Thanks to Robert Penner for
the idea.
        // ==============
        // Thanks to: Robert Penner, Eric Mueller and Michael Hurwicz for
their contributions.
        // ==============
        if (arguments.length<5) {
                return;
        }
        // if yRadius is undefined, yRadius = radius
        if (yRadius == undefined) {
                yRadius = radius;
        }
        // Init vars
        var segAngle, theta, angle, angleMid, segs, ax, ay, bx, by, cx, cy;
        // no sense in drawing more than is needed :)
        if (Math.abs(arc)>360) {
                arc = 360;
        }
        // Flash uses 8 segments per circle, to match that, we draw in a
maximum
        // of 45 degree segments. First we calculate how many segments are
needed
        // for our arc.
        segs = Math.ceil(Math.abs(arc)/45);
        // Now calculate the sweep of each segment
        segAngle = arc/segs;
        // The math requires radians rather than degrees. To convert from
degrees
        // use the formula (degrees/180)*Math.PI to get radians.
        theta = -(segAngle/180)*Math.PI;
        // convert angle startAngle to radians
        angle = -(startAngle/180)*Math.PI;
        // find our starting points (ax,ay) relative to the secified x,y
        ax = x-Math.cos(angle)*radius;
        ay = y-Math.sin(angle)*yRadius;
        // if our arc is larger than 45 degrees, draw as 45 degree segments
        // so that we match Flash's native circle routines.
        if (segs>0) {
                // Loop for drawing arc segments
                for (var i = 0; i<segs; i++) {
                        // increment our angle
                        angle += theta;
                        // find the angle halfway between the last angle and
the new
                        angleMid = angle-(theta/2);
                        // calculate our end point
                        bx = ax+Math.cos(angle)*radius;
                        by = ay+Math.sin(angle)*yRadius;
                        // calculate our control point
                        cx =
ax+Math.cos(angleMid)*(radius/Math.cos(theta/2));
                        cy =
ay+Math.sin(angleMid)*(yRadius/Math.cos(theta/2));
                        // draw the arc segment
                        this.curveTo(cx, cy, bx, by);
                }
        }
        // In the native draw methods the user must specify the end point
        // which means that they always know where they are ending at, but
        // here the endpoint is unknown unless the user calculates it on
their
        // own. Lets be nice and let save them the hassle by passing it
back.
        return {x:bx, y:by};

};

//
//      DRAW CIRCLE FROM OBJECT
//

function circle_draw ( obj:Object )
{
        var mc = obj.mc;
        mc.clear();
        mc.moveTo ( obj.x, obj.y );
        mc.beginFill.apply ( mc, obj.fillStyle );
        mc.lineStyle.apply ( mc, obj.lineStyle );
        mc.drawArc ( obj.x, obj.y, obj.radius, obj.arc, obj.startAngle,
obj.yRadius )

}

//
//      CENTER AND REDRAW CIRCLES
//

function updateCircle ( top_obj, bottom_obj )
{      
        // redraw
        if ( arguments.length > 0 )
        {
                // center
                var X = (Stage.width >> 1);
                var Y = (Stage.height >> 1) - top_obj.yRadius ||
top_obj.radius;

                top_obj.x = X;
                top_obj.y = Y;          
                circle_draw ( top_obj );

                if ( arguments.length > 1 )
                {
                        bottom_obj.x = X;
                        bottom_obj.y = Y;
                        circle_draw ( bottom_obj );
                }
        }

}

//
//      CREATE
//

import caurina.transitions.Tweener
import flash.filters.GlowFilter;

function INIT ()
{
        INIT_create ( );
        INIT_stage ( );
        INIT_glow ( );
        INIT_tween ( );
        onMouseDown = INIT; // resets on mouse press

}

function INIT_stage ()
{
        Stage.scaleMode = 'noScale';
        Stage.align = 'TL';
        Stage.addListener( this );
        bg = this.createEmptyMovieClip("bg", 1);
        onResize = function()
        {
                var W = Stage.width;
                var H = Stage.height;
                bg.clear();
                bg.beginFill(0x333333, 100);
                bg.moveTo(0, 0);
                bg.lineTo(W, 0);
                bg.lineTo(W, H);
                bg.lineTo(0, H);
                bg.lineTo(0, 0);
                bg.endFill();
                updateCircle ( circle_obj, obj_base );
        }
        onResize();

}

function INIT_create ()
{      
        // top
        circle_obj = {
                mc: this.createEmptyMovieClip( "mc", 30 ),
                x:0,
                y:0,
                radius:50,
                arc: 0,
                startAngle: 90,
                yRadius:50,
                lineStyle: [ 15, 0xFFFFFF, 100 ],
                fillStyle: [ ]
        };

        // bottom
        obj_base = {
                mc: this.createEmptyMovieClip( "mc2", 20  ),
                arc: 360,
                x: circle_obj.x,
                y: circle_obj.y,
                radius: circle_obj.radius,
                startAngle: circle_obj.startAngle,
                yRadius: circle_obj.yRadius,
                lineStyle: [ 13, 0xFFFFFF, 20 ],
                fillStyle: circle_obj.fillStyle
        };      

        // draw base
        circle_draw ( obj_base );

}

function INIT_glow ()
{
        // add top glow
        var color:Number = 0xFFFFFF;
        var alpha:Number = .8;
        var blurX:Number = 15;
        var blurY:Number = 15;
        var strength:Number = 2;
        var quality:Number = 3;
        var inner:Boolean = false;
        var knockout:Boolean = false;
        var glow_filter:GlowFilter = new GlowFilter(color,
                alpha,
                blurX,
                blurY,
                strength,
                quality,
                inner,
                knockout);
        circle_obj.mc.filters = [ glow_filter ];

}

function INIT_tween ( )
{
        // tween top - alpha
        circle_obj.mc._alpha = 0;
        Tweener.addTween ( circle_obj.mc, {
          _alpha:100,
          time:1,
          delay:.5,
          transition:'easeOutCubic'

        })

        // tween top - arc
        Tweener.addTween ( circle_obj, {
                arc:-360,
                time:4,
                delay:.2,
                transition:'easeInOutCubic',
                onUpdate: mx.utils.Delegate.create ( this, updateCircle ),
                onUpdateParams:[ circle_obj ]
                });

}

// starts draw and tween
INIT();

_____________________________

Jesse Graupmann
www.jessegraupmann.com
www.justgooddesign.com/blog/
_____________________________


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Muzak  
View profile  
 More options Aug 6 2007, 7:55 pm
From: "Muzak" <p.ginnebe...@telenet.be>
Date: Tue, 7 Aug 2007 01:55:34 +0200
Local: Mon, Aug 6 2007 7:55 pm
Subject: Re: [Flashcoders] Coding a circular preloader

----- Original Message -----
From: "Steven Sacks" <flash...@stevensacks.net>
To: <flashcod...@chattyfig.figleaf.com>
Sent: Monday, August 06, 2007 8:38 PM
Subject: Re: [Flashcoders] Coding a circular preloader

> Easing?  You're showing linear data.  A visual representation of a number from 0-100.  I'm not sure how easing fits into this.

> Your boss sounds like a real genius because it's absolutely brilliant to force somebody to spend many hours building something
> that could be built in 5 minutes - really smart use of time and money.  He should write a book on how to be successful in
> business.

+10 ;-)

when I visited the site mentioned I didn't see any easing at all (I'm on a 20mbit conn).

_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesse Graupmann  
View profile  
 More options Aug 6 2007, 10:52 pm
From: "Jesse Graupmann" <des...@jessegraupmann.com>
Date: Mon, 6 Aug 2007 19:52:35 -0700
Local: Mon, Aug 6 2007 10:52 pm
Subject: RE: [Flashcoders] Coding a circular preloader
Another version using _xmouse to get a Stage.width factor so you can see
easing via onMouseMove.

Nothing extra needed in this example - just copy/paste.

- JG

function drawArc ( mc, x, y, radius, arc, startAngle, yRadius)
{
        // http://www.formequalsfunction.com/downloads/drawmethods.html

        if (arguments.length<5) return;
        if (yRadius == undefined) yRadius = radius;
        var segAngle, theta, angle, angleMid, segs, ax, ay, bx, by, cx, cy;
        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;
        ax = x-Math.cos(angle)*radius;
        ay = y-Math.sin(angle)*yRadius;
        if (segs>0) {
                for (var i = 0; i<segs; i++) {
                        angle += theta;
                        angleMid = angle-(theta/2);
                        bx = ax+Math.cos(angle)*radius;
                        by = ay+Math.sin(angle)*yRadius;
                        cx =
ax+Math.cos(angleMid)*(radius/Math.cos(theta/2));
                        cy =
ay+Math.sin(angleMid)*(yRadius/Math.cos(theta/2));
                        mc.curveTo(cx, cy, bx, by);
                }
        }
        return {x:bx, y:by};

};

//
//      DRAW CIRCLE FROM OBJECT
//

function circle_draw ( obj:Object ):Void
{
        var mc = obj.mc;
        mc.clear();
        mc.moveTo ( obj.x, obj.y );
        mc.beginFill.apply ( mc, obj.fillStyle );
        mc.lineStyle.apply ( mc, obj.lineStyle );
        drawArc ( mc, obj.x, obj.y, obj.radius, obj.arc, obj.startAngle,
obj.yRadius )

}

//
//      SHOW PERCENTAGE IN TEXT
//

function setPer ( per ):Void
{
        txt.text = per + ' %';
        txt.setTextFormat(txt_fmt);
        txt._x = Math.round(circle_holder._x - (txt._width>>1));
        txt._y = Math.round(circle_holder._y + (circle_top.radius*2) +
circle_top.lineStyle[0]);

}

//
//      ADJUST TO NEW PERCENTAGE
//

function adjust_view ()
{
        // per
        var margin = 20;
        var per = Math.max( 0 , Math.min ( 1, (this._xmouse - margin) /
(Stage.width-(margin*2))));
        var new_arc = Math.round( -360 * per );

        // update
        if ( new_arc != dest_arc )
        {
                dest_arc = new_arc;
                        circle_holder.onEnterFrame = function()
                        {
                                cur_arc += (dest_arc - cur_arc) * .1 ;
                                circle_top.arc = cur_arc;
                                circle_draw ( circle_top ); // circle
                                setPer (
Math.round(Math.abs(circle_top.arc)/360*100) ); // txt
                                if ( cur_arc == dest_arc ) delete
circle_holder.onEnterFrame;
                        }
        }

}

//
//      CREATE
//

function INIT()
{

        // circle
        circle_holder = this.createEmptyMovieClip( "circle_holder", 20 );
        cur_arc = 0;
        dest_arc = 0;

        // top circle
        circle_top = {
                mc: circle_holder.createEmptyMovieClip( "mc", 40 ),
                x:0,
                y:0,
                radius:50,
                arc: 0,
                startAngle: 90,
                yRadius: 50,
                lineStyle: [ 15, 0xFFFFFF, 100 ],
                fillStyle: [ ]
        };

        // add top glow
        circle_top.mc.filters = [ new flash.filters.GlowFilter(0xFFFFFF, .8,
15, 15, 2, 3, false, false ) ];
        // bottom circle
        circle_bottom = {
                mc: circle_holder.createEmptyMovieClip( "mc2", 30  ),
                arc: 360,
                x: circle_top.x,
                y: circle_top.y,
                radius: circle_top.radius,
                startAngle: circle_top.startAngle,
                yRadius: circle_top.yRadius,
                lineStyle: [ 13, 0xFFFFFF, 20 ],
                fillStyle: circle_top.fillStyle
        };      

        // txt
        txt = this.createTextField("txt", 100, 100, 100, 300, 100);
        txt.multiline = false;
        txt.autoSize= true;
        txt.wordWrap = false;
        txt_fmt = new TextFormat();
        txt_fmt.color = 0xFFFFFF;

        // stage
        Stage.scaleMode = 'noScale';
        Stage.align = 'TL';
        Stage.addListener( this );
        bg = this.createEmptyMovieClip("bg", 10 );
        onResize = function ()
        {
                var W = Stage.width;
                var H = Stage.height;
                bg.clear();
                bg.beginFill(0x333333, 100);
                bg.moveTo(0, 0);
                bg.lineTo(W, 0);
                bg.lineTo(W, H);
                bg.lineTo(0, H);
                bg.lineTo(0, 0);
                bg.endFill();

                circle_holder._x = (W>>1);
                circle_holder._y = (H>>1)- circle_top.radius;
        }
        circle_draw ( circle_top );
        circle_draw ( circle_bottom );

        onMouseMove = adjust_view;
        onResize();
        setPer ( 0 );

}

INIT();

_____________________________

Jesse Graupmann
www.jessegraupmann.com  
www.justgooddesign.com/blog/  
_____________________________


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Omar Fouad  
View profile  
 More options Aug 7 2007, 6:51 am
From: "Omar Fouad" <omarfouad....@gmail.com>
Date: Tue, 7 Aug 2007 13:51:52 +0300
Local: Tues, Aug 7 2007 6:51 am
Subject: Re: [Flashcoders] Coding a circular preloader
Thanks Jesse, this was a very good idea.....

On 8/7/07, Jesse Graupmann <des...@jessegraupmann.com> wrote:

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Some CS3 observations; library and sound" by Andreas R
Andreas R  
View profile  
 More options Aug 7 2007, 9:10 am
From: Andreas R <andreas.ronn...@rayon.no>
Date: Tue, 07 Aug 2007 15:10:27 +0200
Local: Tues, Aug 7 2007 9:10 am
Subject: [Flashcoders] Some CS3 observations; library and sound
Been using CS3 for a bit now, getting to grips with AS3, and what feels
like excessive handholding at first is now flowing naturally, and i feel
far less prone to silent failures than before. To me this is entirely
excellent, good show!

The IDE however, i am less impressed with, and i am hoping to be wrong
or ignorant so some of you can correct me in my ridiculous ways.

Overall, i feel as though AS3 integration in the Flash 9 IDE appears
tacked on, or retrofitted. Experimenting with AS3 early on in flex and
with apollo gave a far, far stronger impression of the strengths of the
language than how it appears when used in tandem with the IDE,
particularly in how AS3 handles sound and the library.

AS3's substitution of attachMovie for the movieclip constructor is,
while logical on the surface, somewhat baffling to me in practise. In
AS2, extending MovieClip required you to declare variables to gain
references to clips already instanced in the library movieclip. For
instance, extending a movieclip containing a textfield with instance
name "nameField" would require var nameField:TextField to gain control
of that field in the class. What this gives you on script level is an
overview of relevant movieclip members, as well as code completion. In
AS3, declaring variables to refer to hand placed movieclip members
throws an error:

1151: A conflict exists with definition x in namespace internal.

This effectively forces us to write notes about movieclip members in
comments or the like, and denies us code completion. I'm not sure how
i'd deal with this more effectively, but i do sorely miss being able to
do this in the old fashioned way. If there is a faster, more convenient
workflow, please inform me :)

Secondly, where the Timer class allows us a "safe" way to
programmatically trigger callbacks without the setInterval danger of
orphaned intervals, the new Sound/SoundChannel symbiose allows us to
freely orphan sounds, while forcing us to keep track of separate class
instances to have specific control of individual sounds, easily lost
should the reference to the relevant SoundChannel be overwritten.

The current sound toolkit appears eclectic, almost chaotic, and in my
opinion performs even worse than its previous incarnation

Sound: Loads and plays streamed audio, provides close() method to stop
streaming sound, dispatches events to keep track of load progress, takes
a soundtransform instance
SoundChannel: gives playback and level information and an event when
sound playback ends. Contains another method to stop sound, which
DOESN'T work for streamed sound, yet a SoundChannel instance is
nonetheless required to alter properties of streaming sound during playback.
SoundTransform: Encapsulates all pan and volume properties previously
associated with the Sound class.
SoundMixer: static class containing global methods and properties for
all sounds.

Out of these 4, the Sound/SoundChannel relationship with their dual stop
methods makes me wonder what the rationale behind it all really was. The
SoundChannel class in my opinion has no logical place in the hierarchy
given that it doesn't actually give us any real control of the channel
in question. Were we able to declare a SoundChannel and pass it Sounds
to play it'd be a different matter. In addition, the name SoundMixer is
a complete misnomer, as the class offers absolutely no channel-specific
controls, nor does it keep track of currently playing channels.

I applaud being able to source audio externally, but i'm bewildered by
the choices of terminology and the weird sound/channel symbiose. The
docs insist the API is powerful, but i don't see how it is, aside from
external sourcing of audio.

So overall, i enjoy AS3, but its integration with IDE workflow seems
unfinished and awkward.

Anyone want to correct me? Please? :)

--
mvh

Andreas Rønning
Senior Flash developer
-----------------------------
Rayon Visual Concepts

_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zeh Fernando  
View profile  
 More options Aug 7 2007, 9:38 am
From: Zeh Fernando <zehferna...@zeh.com.br>
Date: Tue, 07 Aug 2007 10:38:16 -0300
Local: Tues, Aug 7 2007 9:38 am
Subject: Re: [Flashcoders] Some CS3 observations; library and sound

> AS3's substitution of attachMovie for the movieclip constructor is,
> while logical on the surface, somewhat baffling to me in practise. In
> AS2, extending MovieClip required you to declare variables to gain
> references to clips already instanced in the library movieclip. For
> instance, extending a movieclip containing a textfield with instance
> name "nameField" would require var nameField:TextField to gain control
> of that field in the class. What this gives you on script level is an
> overview of relevant movieclip members, as well as code completion. In
> AS3, declaring variables to refer to hand placed movieclip members
> throws an error:

> 1151: A conflict exists with definition x in namespace internal.

When using classes, go to your publish settings, actionscript, and turn
off "automatically declare stage instances" and it should behave as it
did before -- you'll need to declare stage instances yourself. I agree
that's odd, I use it off, but I guess they decided to add it on by
default is so beginners wouldn't have trouble dealing with elements when
coding 'on the timeline'.

Zeh
_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas R  
View profile  
 More options Aug 7 2007, 10:45 am
From: Andreas R <andreas.ronn...@rayon.no>
Date: Tue, 07 Aug 2007 16:45:50 +0200
Local: Tues, Aug 7 2007 10:45 am
Subject: Re: [Flashcoders] Some CS3 observations; library and sound

my god, thank you so much :)

--
mvh

Andreas Rønning
Senior Flash developer
-----------------------------
Rayon Visual Concepts
Karenslyst allè 16f
0214 Oslo, Norway
t: +47 22 13 52 50
f: +47 22 13 52 60
www.rayon.no

_______________________________________________
Flashcod...@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 27   Newer >
« Back to Discussions « Newer topic     Older topic »