[Flashcoders] RE: AS3 events, events

2008-07-12 Thread [EMAIL PROTECTED]
Thanks Jason. What you suggested is what I put together during the interim.

All events bubble up to Main which then calls a method on whatever instance
it has to.

So is this the way events are usually handled in AS3. So you bubble up an
event to the highest object in the chain, and have it handle the event?.

Makes sense I supose.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] 2D and 3D floor plans

2008-07-12 Thread Charles Parcell
FF3
FP10b

Going to 3d view crashes the browser.

The 2D builder is very nice. lots of time has obviously been put into this.
Great job!

Charles P.


On Tue, Jul 8, 2008 at 10:36 AM, Gert-Jan van der Wel <
[EMAIL PROTECTED]> wrote:

> Hi list,
>
> Maybe a little spammy message, but I just wanted to let you know that we
> released a new version of Floorplanner that's now open for beta testers.
> This version has better 2D/3D integration and it's finally possible to show
> furniture elements in 3D (using Papervision 3D of course :-)
>
> So if you feel like giving it a test drive, click on one of these links:
> http://beta.floorplanner.com/
> http://beta.floorplanner.com/demo
> http://beta.floorplanner.com/start
>
> Thanks!
> Gert-Jan
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Is a precise timer for making rhythms possible?

2008-07-12 Thread Eric E. Dolecki

I think he means a prior composition

Sent from my iPod

On Jul 12, 2008, at 3:55 PM, "Kerry Thompson"  
<[EMAIL PROTECTED]> wrote:



Ron Wheeler wrote:


If you have a playback button that plays the composed work, you can
concatenate the sounds/notes "selected" and play the composed  
segment.


That's interesting--can that be done at runtime? How can you  
concatenate the sounds?


Cordially,

Kerry Thompson


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Is a precise timer for making rhythms possible?

2008-07-12 Thread Kerry Thompson
Ron Wheeler wrote:

> If you have a playback button that plays the composed work, you can
> concatenate the sounds/notes "selected" and play the composed segment.

That's interesting--can that be done at runtime? How can you concatenate the 
sounds?

Cordially,

Kerry Thompson


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Error #1009 and gotoAndStop()

2008-07-12 Thread Steven Sacks
Creat a function that does the setting on the TextField and call it from 
that frame.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Is a precise timer for making rhythms possible?

2008-07-12 Thread Ron Wheeler
This approach has the potential to be extended to merge 2 or more 
generated tracks (instruments) with some consideration of volume balance 
between the tracks.
One would concatenate the notes in each track, merge and balance the 
mp3s and play back the composite mp3 song.


Ron


Ron Wheeler wrote:


If the composer is playing as notes are entered, timing is not an 
issue. Fancy electric organ for the typest :-)


If you have a playback button that plays the composed work, you can 
concatenate the sounds/notes "selected" and play the composed segment.


Ron

Abe Pazos wrote:
I guess this is meant for Kerry? I think he IS playing songs in a 
sequence. Maybe he needs to synchronize graphic elements to the 
starting of parts?


In my case, I've built a composer tool and the order is not 
predefined, actually is ever changing, so I can't merge the sounds.


 
Why not just concatenate the mp3 files into 1 file and play it as a 
single sound track?


Ron

Abe Pazos wrote:
   
I don't understand how MP3 can take longer to start. Isn't the AIFF 
  

converted to MP3 anyways by the IDE?
   
I'm preloading the MP3s from disk. I have generated them myself, so 
they are   
trimmed until the last sample. Is there something that causes random 
delays when starting MP3s?
   
To test the SOUND_COMPLETE event, I have created a very short 
sample (about   
1 ms long) which acts as a metronome. I count when it has played 5 
times, I play a bass drum. The timing I get is quite random. So I 
don't understand how do you get such perfect timing with your 
playlist class. Or maybe the problem is that I'm looking for much 
more precision than what you needed for the music...
   

Here is my test code:

var pCounter:int = 5;
var pMetro:Sound = new metronome(); // 1 ms sample to act as a timer
var pChannel:SoundChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
var pTime:int = getTimer();
function onComplete(tEvent:Event):void {
pChannel.removeEventListener(Event.SOUND_COMPLETE, onComplete);
pChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
trace(getTimer() - pTime);
pTime = getTimer();
if (pCounter-- > 0) {
return;
}
pCounter = 5;

(new BassDrum()).play();

}

These are the times traced:
107 285 48 53 55 104 59 14 42 47 57 34 47 45 45 80 15 43 47 49 47
57 33 46 47 44 84 52 69 24 100 40 72 27 63 64 26 42 44 44 73 20
44 45 47 45 54 38 48 45 57 62 21 43 46 45 49 54 35 45 45 46 67
24 47 45 46 50 53 34 45 46 105 33 45 46 46 78 26 56 23 44 106 55
45 46 45 60 38 42 42 55 58 22 46 45 47 47 48 40 47 44 48 72 18 44

For what I've read, since the sound buffer size in XP is 2048 samples,
I should be getting a stable 46 ms delay.

The problem is there with and without trace().

If I can't fix it I will just use it like it is now. Anyways it 
adds a   

less-machine more-human(drunk) like touch :)
   

Thanks for your reply,

Abe


   
As Jason mentioned, I've been going through the same process for a 
very demanding client--one of the country's best music schools. My 
project is to string together several audio clips, and 
make it sound like a real song, 
with

absolutely no glitches. Here's what I've found:

- Use AS3. AS2 isn't fast enough.
- Timers have limited usability, because they can be off by 
several milliseconds. I tried that approach, and abandoned it 
after the prototype stage.
- MP3's take too long to start playing, and tend to have glitches 
like pops and clicks. A program Steven Sacks recommended, 
MP3Trim, helped, but still didn't raise it to the 
professional level.
- Aiff files at 44.1/16 seem to be the best solution (wav files 
would 
probably

work too, but my client does all the asset prep on the Mac).

I wrote a playlist class that has methods to build a playlist and 
to play 
it.
The play method simply steps through the array of sounds you have 
built. 
It's
its own listener for the SOUND_COMPLETE event, and keeps playing 
until it reaches the end of the playlist.


That approach works for all but a few songs, where it's just not 
precise enough. For example, there's a pretty hyper guitar solo 
from "American 
Idiot",
with fast 16th notes (tempo about 128), and I needed to drop in 
one 
sixteenth
note in the middle of a run. The delay was just long enough--maybe 
1/100 second--to make it sound like a hesitation. We had to drop 
that song from 
the

game.

Cordially,

Kerry Thompson


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_

[Flashcoders] "Auto declare stage instance" issue with SWC

2008-07-12 Thread Todd Dominey

Hi everyone -

Here's my setup. I have a MovieClip named "TimerSymbol" in the Library  
with a base class of "flash.display.MovieClip" assigned to it. The  
class associated with it is public and extends MovieClip.  
"TimerSymbol" contains a MovieClip inside of it with an instance name  
of "icons_mc". "TimerSymbol" is instantiated inside of a parent Sprite  
class, which will serve as the base class of my SWC.


Now, I have "Automatically declare stage instances" ticked "on", and I  
need to leave it on because that's the default setting other people  
would be using.


With that, I'm not directly referring to "icons_mc" in my TimerSymbol  
class to avoid name conflicts. I'm getting the instance like so:


public var icons:MovieClip;
icons = getChildByName('icons_mc') as MovieClip;

And that seems to work fine. BUT, the problem emerges when I "Convert  
to Compiled Clip" and publish again from a separate FLA. This time I  
get...


ReferenceError: Error #1056: Cannot create property icons_mc on  
com.dd.observers.Timer.

at flash.display::Sprite/flash.display:Sprite::constructChildren()
at flash.display::Sprite$iinit()
at flash.display::MovieClip$iinit()
(blah blah blah)

Any ideas what could be causing this?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Is a precise timer for making rhythms possible?

2008-07-12 Thread Ron Wheeler


If the composer is playing as notes are entered, timing is not an issue. 
Fancy electric organ for the typest :-)


If you have a playback button that plays the composed work, you can 
concatenate the sounds/notes "selected" and play the composed segment.


Ron

Abe Pazos wrote:

I guess this is meant for Kerry? I think he IS playing songs in a sequence. 
Maybe he needs to synchronize graphic elements to the starting of parts?

In my case, I've built a composer tool and the order is not predefined, 
actually is ever changing, so I can't merge the sounds.

  
Why not just concatenate the mp3 files into 1 file and play it as a 
single sound track?


Ron

Abe Pazos wrote:

I don't understand how MP3 can take longer to start. Isn't the AIFF 
  

converted to MP3 anyways by the IDE?

I'm preloading the MP3s from disk. I have generated them myself, so they are 
  
trimmed until the last sample. Is there something that causes random delays 
when starting MP3s?

To test the SOUND_COMPLETE event, I have created a very short sample (about 
  
1 ms long) which acts as a metronome. I count when it has played 5 times, I 
play a bass drum. The timing I get is quite random. So I don't understand how 
do you get such perfect timing with your playlist class. Or maybe the problem 
is that I'm looking for much more precision than what you needed for the 
music...


Here is my test code:

var pCounter:int = 5;
var pMetro:Sound = new metronome(); // 1 ms sample to act as a timer
var pChannel:SoundChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
var pTime:int = getTimer();
function onComplete(tEvent:Event):void {
pChannel.removeEventListener(Event.SOUND_COMPLETE, onComplete);
pChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
trace(getTimer() - pTime);
pTime = getTimer();
if (pCounter-- > 0) {
return;
}
pCounter = 5;

(new BassDrum()).play();
}

These are the times traced:
107 285 48 53 55 104 59 14 42 47 57 34 47 45 45 80 15 43 47 49 47
57 33 46 47 44 84 52 69 24 100 40 72 27 63 64 26 42 44 44 73 20
44 45 47 45 54 38 48 45 57 62 21 43 46 45 49 54 35 45 45 46 67
24 47 45 46 50 53 34 45 46 105 33 45 46 46 78 26 56 23 44 106 55
45 46 45 60 38 42 42 55 58 22 46 45 47 47 48 40 47 44 48 72 18 44

For what I've read, since the sound buffer size in XP is 2048 samples,
I should be getting a stable 46 ms delay.

The problem is there with and without trace().

If I can't fix it I will just use it like it is now. Anyways it adds a 
  

less-machine more-human(drunk) like touch :)


Thanks for your reply,

Abe


  
  
As Jason mentioned, I've been going through the same process for a very 
demanding client--one of the country's best music schools. My project is to 

string together several audio clips, and make it sound like a real song, 

with 


absolutely no glitches. Here's what I've found:

- Use AS3. AS2 isn't fast enough.
- Timers have limited usability, because they can be off by several 
milliseconds. I tried that approach, and abandoned it after the prototype 
stage.
- MP3's take too long to start playing, and tend to have glitches like pops 

and clicks. A program Steven Sacks recommended, MP3Trim, helped, but still 

didn't raise it to the professional level.
- Aiff files at 44.1/16 seem to be the best solution (wav files would 

probably 


work too, but my client does all the asset prep on the Mac).

I wrote a playlist class that has methods to build a playlist and to play 

it. 

The play method simply steps through the array of sounds you have built. 

It's 

its own listener for the SOUND_COMPLETE event, and keeps playing until it 
reaches the end of the playlist.


That approach works for all but a few songs, where it's just not precise 
enough. For example, there's a pretty hyper guitar solo from "American 

Idiot", 

with fast 16th notes (tempo about 128), and I needed to drop in one 

sixteenth 

note in the middle of a run. The delay was just long enough--maybe 1/100 
second--to make it sound like a hesitation. We had to drop that song from 

the 


game.

Cordially,

Kerry Thompson


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  
  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.c

[Flashcoders] Error #1009 and gotoAndStop()

2008-07-12 Thread Pavel Krůšek

Hi List,

i have MovieClip with some keyframes, on each keyframe is dynamic  
TextField with different properties (font, color etc.).


In constructor - class NavigationItem.as I'm trying to jump to frame  
and fill TextField with some text:




gotoAndStop( _level );
_label.text = label;
_label.autoSize = TextFieldAutoSize.LEFT;



TypeError: Error #1009: Cannot access a property or method of a null  
object reference.


It is clear for me - the script runs before frame in the animation has  
been reached, but how it fix?


Thanks

Pavel
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders