RE: [Flashcoders] How can I get a string in a date object ?

2006-11-02 Thread Sander van Surksum
Thanks I've already fixed it 

This is the string I get from php 

tijdAlles=2006:11:02:08:39:40&

This is the function

function checkTime(){
trace(this);
var s_date = this.tijdAlles;
function dateStringToObject(dateString){
var date_ar = dateString.split(":");
trace(date_ar[0]);
return new Date(date_ar[0], date_ar[1]-1, date_ar[2],
date_ar[3], date_ar[4], date_ar[5]);
}
var myDateObj = dateStringToObject(s_date);
trace("myDateObj = "+myDateObj);


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven
Sacks | BLITZ
Sent: woensdag 1 november 2006 20:04
To: Flashcoders mailing list
Subject: RE: [Flashcoders] How can I get a string in a date object ?


The compiler only catches strict typing issues at compile-time, not
run-time.  It doesn't know what this.jaar is (because it's being loaded
in at run-time) so it doesn't catch that you're loading a string into
it.  Since AS2 isn't actually strict (just for the compiler's sake), you
can put strings into variables you type cast as Number.  You need to
type cast the strings as numbers when they load in.

var jarr:Number = Number(this.jaar);

etc.

HTH,
Steven

___
Flashcoders@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
___
Flashcoders@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


Re: [Flashcoders] Useful Ascii codes:

2006-11-02 Thread Meinte van't Kruis

lol..
well, still nice of you tho :)

On 11/1/06, eric dolecki <[EMAIL PROTECTED]> wrote:


Oh man... i wish i had seen that... thanks for the link!

On 11/1/06, Michael Stuhr <[EMAIL PROTECTED]> wrote:
>
> eric dolecki schrieb:
> > I never wanna do this again, and you probably don't either, so here
are
> some
> > constants to make using ascii values of character codes more
legible...
> >
> > - e.
> >
> > 
> > // Constants (to make logic more readible)
> > var KEY_EXCLAMATION:Number = 33;
> > var KEY_DOUBLE_QUOTE:Number = 34;
> > var KEY_POUND:Number = 35;
> > var KEY_DOLLAR:Number = 36;
> > var KEY_PERCENTAGE:Number = 37;
> > var KEY_AND:Number = 38;
> > var KEY_SINGLE_QUOTE:Number = 39;
> > var KEY_LEFT_PAREN:Number = 40;
> > var KEY_RIGHT_PAREN:Number = 41;
> > var KEY_STAR:Number = 42;
> > var KEY_PLUS:Number = 43;
> > var KEY_COMMA:Number = 44;
> > var KEY_MINUS:Number = 45;
> > var KEY_PERIOD:Number = 46;
> > var KEY_SLASH:Number = 47;
> >
> > var KEY_0:Number = 48;
> > var KEY_1:Number = 49;
> > var KEY_2:Number = 50;
> > var KEY_3:Number = 51;
> > var KEY_4:Number = 52;
> > var KEY_5:Number = 53;
> > var KEY_6:Number = 54;
> > var KEY_7:Number = 55;
> > var KEY_8:Number = 56;
> > var KEY_9:Number = 57;
> >
> > var KEY_COLON:Number = 58;
> > var KEY_SEMI_COLON:Number = 59;
> > var KEY_LESS_THAN:Number = 60;
> > var KEY_EQUAL:Number = 61;
> > var KEY_GREATER_THAN:Number = 62;
> > var KEY_QUESTION_MARK:Number = 63;
> > var KEY_AT_SYMBOL:Number = 64;
> >
> > var KEY_A:Number = 65;var KEY_a:Number = 97;
> > var KEY_B:Number = 66;var KEY_b:Number = 98;
> > var KEY_C:Number = 67;var KEY_c:Number = 99;
> > var KEY_D:Number = 68;var KEY_d:Number = 100;
> > var KEY_E:Number = 69;var KEY_e:Number = 101;
> > var KEY_F:Number = 70;var KEY_f:Number = 102;
> > var KEY_G:Number = 71;var KEY_g:Number = 103;
> > var KEY_H:Number = 72;var KEY_h:Number = 104;
> > var KEY_I:Number = 73;var KEY_i:Number = 105;
> > var KEY_J:Number = 74;var KEY_j:Number = 106;
> > var KEY_K:Number = 75;var KEY_k:Number = 107;
> > var KEY_L:Number = 76;var KEY_l:Number = 108;
> > var KEY_M:Number = 77;var KEY_m:Number = 109;
> > var KEY_N:Number = 78;var KEY_n:Number = 110;
> > var KEY_O:Number = 79;var KEY_o:Number = 111;
> > var KEY_P:Number = 80;var KEY_p:Number = 112;
> > var KEY_Q:Number = 81;var KEY_q:Number = 113;
> > var KEY_R:Number = 82;var KEY_r:Number = 114;
> > var KEY_S:Number = 83;var KEY_s:Number = 115;
> > var KEY_T:Number = 84;var KEY_t:Number = 116;
> > var KEY_U:Number = 85;var KEY_u:Number = 117;
> > var KEY_V:Number = 86; var KEY_v:Number = 118;
> > var KEY_W:Number = 87;var KEY_w:Number = 119;
> > var KEY_X:Number = 88;var KEY_x:Number = 120;
> > var KEY_Y:Number = 89;var KEY_y:Number = 121;
> > var KEY_Z:Number = 90;var KEY_z:Number = 122;
> >
> > var KEY_LEFT_BRACKET:Number = 91;
> > var KEY_BACKSLASH:Number = 92;
> > var KEY_RIGHT_BRACKET:Number = 93;
> > var KEY_CARRET:Number = 94;
> > var KEY_UNDERSCORE:Number = 95;
> > var KEY_APOS:Number = 96;
> > 
> > ___
> > Flashcoders@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
> >
> ahh, reminds me of:
> http://proto.layer51.com/d.aspx?f=500
>
> micha
> ___
> Flashcoders@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
>
___
Flashcoders@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


___
Flashcoders@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


RE: [Flashcoders] Flash Print Function and Callbacks ?

2006-11-02 Thread Mike Keesey
Pretty sure you can't.

Just noticed something odd whil looking at the documentation on AS3.0's
ProntJob class (http://livedocs.macromedia.com/flex/2/langref/)--it
extends EventDispatcher, yet it doesn't have any documented events. Vot
der hey?
―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Stephen Ford
> Sent: Wednesday, November 01, 2006 9:57 PM
> To: flashcoders@chattyfig.figleaf.com
> Subject: [Flashcoders] Flash Print Function and Callbacks ?
> 
> Does anyone know if Flash's built in Print command has anyway of
providing
> a callback once a print job has been executed ??
> 
> I need to set a clips visibility to false while the printing takes
place,
> then set it back to visible once the print executes ??
> 
> Is this possible ??
> 
> Thanks,
> Stephen.
> 
>  ___
> Flashcoders@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

___
Flashcoders@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


[Flashcoders] getTextSnapshot() Highlighting Disappears

2006-11-02 Thread Leif Wells

Greetings Flashcoders,

I am trying to implement text search capability in a project using
getTextSnapshot() to get all the text in an externally loading SWF and
running code that loops through and highlights found words, i.e. if you type
in "the" then all the text that has "the" in it gets highlighted in yellow.

My problem is that the swf, which is loading into a ScrollPane, will
un-highlight the found items after a few seconds or after 40 seconds (there
doesn't seem to be a consistent time frame -- but it always happens).

I've played with the file for a few hours to try and find a pattern and I've
run through the code for MX components that I am using and haven't found any
clues.

Has anyone seen this behavior before? Suggestions?

Leif
Atlanta
___
Flashcoders@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


[Flashcoders] major cache issues --> browser and ASO? --> insanity sets in.

2006-11-02 Thread dnk

Hi there.. I have a movie that loads other swf's that make remoting calls.

Now i have a FLA where I removed some text fields, and then added some 
as well as modifying my class to react with these fields.


Now I have deleted my ASO folder, cleared my browser cache, deleted the 
old file from my ftp server, rebooted my machine, and compiled my FLA, 
then uploaded, and for some reason my flash file shows the old text fields!


This is driving me insane! I have tried in firefox and safari (so yes I 
am on a mac), and the issue is the same! I have tried switching file 
names, appending URL strings and so on


Is there some other flash caching mechanism i am missing?

help?!?!?!


Dustin


___
Flashcoders@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


[Flashcoders] OT (sort of) CD Protection

2006-11-02 Thread Chuck.Lewis
Sorry for the OT, but I just found out the SafeDisc from Macrovision is unable 
to apply CD duplication to a product I created with Flash.
 
Does anyone have suggestions or products used for protecting against CD 
duplication?
 
This does not have to be a super hard core solution since our target audience 
is not that type of audience that would try to hack.
 
-- Chuck
___
Flashcoders@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

RE: [Flashcoders] Flash Print Function and Callbacks ?

2006-11-02 Thread Steven Sacks | BLITZ
Flash doesn't have access to the operating system on any platform.
___
Flashcoders@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


[Flashcoders] Copy Constructor

2006-11-02 Thread Paul Steven
Hi there 

Is there an equivalent of the Java Copy constructor in Flash AS2?

Thanks

Paul

___
Flashcoders@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


[Flashcoders] Shared fonts, linkage and Arabic

2006-11-02 Thread Danny Kodicek
I can't believe I'm still having problems with this.

I need to get a shared font symbol to include Arabic characters (and indeed
any characters). So I've got my shared library called sharedFontLib. In it,
I've created a font symbol called sharedFont. Now, if I leave linkage off,
this font works perfectly: I can include an input field in sharedFontLib
using the font, and type in any characters I like. But if I turn linkage on
for the font, all non-Roman characters stop working (this is with Embed ->
all on the input field). The same is true in other movies using the same
font. 

Come on folks - someone there must have got shared fonts working with
non-Roman characters!

Danny

___
Flashcoders@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


[Flashcoders] Flash Reomoting Service not connecting

2006-11-02 Thread Liam Mincy
Thanks for the code Mat, but this is just about what I have in my movie except 
you
use an object to hold the listener functions while I just use functions. 

What I have found after much a sleepless night is that the movie plays and 
executes
fine in Flash Player 8 and Player 7 but just fails miserably in Flash Player 9. 
I am
not sure why this is happening but am looking for a solution. It may have 
something
to do with the Flash movies I have beinf made for Flash 7 that is causing the
prolem, but I am not certain at this point.

But at least it's a start...

Thanks,
liam m-


--- "Miles, Mathew" <[EMAIL PROTECTED]> wrote:

> I had this problem about 6 months ago and I don't remember how I solved
> it.  However, here is the code that I currently use to make the
> connection and return results.  Hope it helps.
> 
> 
> # 
> 
> import mx.remoting.Service;
> import mx.services.Log;
> import mx.rpc.RelayResponder;
> import mx.rpc.FaultEvent;
> import mx.rpc.ResultEvent;
> import mx.remoting.PendingCall;
> import mx.remoting.RecordSet;
> 
> 
> //###SETUP CONNECTION###
> var contactService:Service = new Service(
>"http://abish.byui.edu/flashservices/gateway?";,
>//"http://localhost:8500/flashservices/gateway?";, 
>null,
>"wsmri.WsmriDate1",
>null,
>null);
> //#
> 
> 
> //##GET RECORDS#
> function fgetMarriageRecords(fName, lname, strID, searchType,
> state_Svar, county_Svar, dateLimit, bDate, eDate){
>   var pc:PendingCall = contactService.getRecordsWDate({FirstName:
> fName, LastName: lname, strID: strID, searchType: searchType, mState:
> state_Svar, county: county_Svar, dateLimit: dateLimit, bDate: bDate,
> eDate: eDate});
>   var oResult:Object = new Object();
>   oResult.onResult = function(re:ResultEvent){
>   var rs:RecordSet = RecordSet(re.result);
>   var nCount:Number = rs.length;
>   recNum_label.text = rs.length;
>   //trace("length is : " + rs.length);
>   //if no results returned show message screen
>   if (rs.length == 0) {
>   noResults1_mc._visible = true;;
>   this.noResults1_mc.ok_btn.setFocus();
>   }
>   results_dg.dataProvider = rs;
>   results_dg.selectedIndex = 0;
>   searchInProgress1_mc._visible = false;
>   // marker for mouse pointer
> 
>   };
>   oResult.onFault = function(re:ResultEvent){
>   //trace("> fault >");
>   for(var i in re){
>   //trace(i + " = " + re[i]);
>   for(var j in re[i]){
>   //trace(j + " = " + re[i][j]);
>   }
>   }
>   };
>   pc.responder = new RelayResponder(oResult, "onResult", "onFault"
> );
> }
> ###END GET RECORDS###

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Flashcoders@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


[Flashcoders] math for getting textField's line number? ie height/(font.size+font.leading) ??

2006-11-02 Thread grimmwerks

It's time for one of those brainfarts.

I'm trying to position a textField's bottom in line with other
textfields; I've added leading to all the textField's so my math is
now off.

All the single-line textFields are positioned properly, but the
mutli-line textfields are not.

In the one I'm testing out with, the font size is 30, and the leading
is -10. So I did this:

lineCount = (txt._height/(font.size + font.leading))

This never works for my example, ie ht = 70, size = 30, leading = -10
 ie  70/(30+-10) == 1.6


What am I missing?
___
Flashcoders@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


[Flashcoders] Music visualisation in Flash 9

2006-11-02 Thread Jake Prime

Hi

I have just been asked about the possibility of making an app which
will play MP3s, and display visual effect to match it. Does this sound
like something that is possible in AS3?

As I see it the issues are:

- being able to load and play an MP3 from the users harddrive
- converting the MP3 to PCM format
- analysing the PCM for volume / tempo (and possibly frequency)

I will be researching this fully myself now, but if anyone has any
experiences or thoughts they want to share I'd be grateful.

Cheers
Jake
___
Flashcoders@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


Re: [Flashcoders] AS 3 - lockroot

2006-11-02 Thread Meinte van't Kruis

since there's no root in as3, i wouldnt know what lockroot is supposed to
do, what are you trying to accomplish?

Meinte

On 11/1/06, Dave Geurts <[EMAIL PROTECTED]> wrote:


Does anybody know anything about implementing something similar as
lockroot for as3.  The only thing I have found in my searches is in the
migration guide it says lockroot has been removed.

   Thanks!


___
Flashcoders@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



___
Flashcoders@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


[Flashcoders] OT conver java code to flash

2006-11-02 Thread Paul Steven
Not familiar with Java code but trying to rewrite some code in Flash. Anyone
convert this line to flash actionscript please

if (Math.abs(rand.nextInt()) % 1 <
(1 / numOfEqual)) 
bestXPos = i;

Thanks

Paul

___
Flashcoders@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


RE: [Flashcoders] OT (sort of) CD Protection

2006-11-02 Thread Laurie Jensen
I now use Star-force from www.star-force.com.  That's a high level CD copy
protection system that provides similar functionality to Macrovision's
SafeDisk.  I don't know whether Flash will be OK or not.

There's also some others like Sony's securom.

Alternatively you can use a wrapper type system that means that people have
to have a key to use your product-so you need to register each user and
provide them with a unique key.  We use Armadillo from
http://siliconrealms.com/index.shtml

All these system have a learning curve.  By that I mean that implementing
this kind of protection is not an insignificant task, nor one that you can
simply pass off to a vendor (though perhaps Macrovision might like you to
think otherwise.)

Laurie 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Friday, 3 November 2006 4:39 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] OT (sort of) CD Protection

Sorry for the OT, but I just found out the SafeDisc from Macrovision is
unable to apply CD duplication to a product I created with Flash.
 
Does anyone have suggestions or products used for protecting against CD
duplication?
 
This does not have to be a super hard core solution since our target
audience is not that type of audience that would try to hack.
 
-- Chuck


___
Flashcoders@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


Re: [Flashcoders] Music visualisation in Flash 9

2006-11-02 Thread slangeberg

RE your points:

- being able to load and play an MP3 from the users harddrive




You'll need an executable wrapper.

- converting the MP3 to PCM format

- analysing the PCM for volume / tempo (and possibly frequency)



Not sure if these are necessary, as I believe what you need is within the
AS3 classes. People have been creating these for a while. See andre
michelle. He's also got some nice examples in his 'labs' section:

http://blog.andre-michelle.com/2006/spectrum-meter/


Scott


On 11/2/06, Jake Prime <[EMAIL PROTECTED]> wrote:


Hi

I have just been asked about the possibility of making an app which
will play MP3s, and display visual effect to match it. Does this sound
like something that is possible in AS3?

As I see it the issues are:

- being able to load and play an MP3 from the users harddrive
- converting the MP3 to PCM format
- analysing the PCM for volume / tempo (and possibly frequency)

I will be researching this fully myself now, but if anyone has any
experiences or thoughts they want to share I'd be grateful.

Cheers
Jake
___
Flashcoders@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





--

: : ) Scott
___
Flashcoders@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


Re: [Flashcoders] Flash Reomoting Service not connecting

2006-11-02 Thread Liam Mincy
I am accesing the SWF inside of a .NET page but it is just putting it on the 
page.
Nothing special there. 

The issue I am seeing now is that it seems that my MX04 movie just blows up when
loaded in Flash Player 9 it seems. Seems to work well and without flaw in 
Player 8.
Still working on this one...

liam m-


--- Ray Chuan <[EMAIL PROTECTED]> wrote:
> Hi,
> - how are you opening the SWF? Is your swf loading any swfs/files?
> This won't work (without work):
> 
> http://domain.com/flash.HTML
> 
> http://domain.com/assets/flash.SWF
> 


 

Access over 1 million songs - Yahoo! Music Unlimited 
(http://music.yahoo.com/unlimited)

___
Flashcoders@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


Re: [Flashcoders] Music visualisation in Flash 9

2006-11-02 Thread Martin Wood-Mitrovski



Jake Prime wrote:

Hi

I have just been asked about the possibility of making an app which
will play MP3s, and display visual effect to match it. Does this sound
like something that is possible in AS3?


Its easy in AS3, just look up Sound.computeSpectrum in the reference.

you'll also find code examples on the internet.

such as

http://blog.andre-michelle.com/2006/soundmixercomputespectrum/

and

http://www.martijndevisser.com/blog/article/as3-computespectrum-bitmapdata


___
Flashcoders@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


Re: [Flashcoders] OT conver java code to flash

2006-11-02 Thread slangeberg

Probably similar to:

var bestXPos:Number;
var numOfEqual:Number = (??); //whatever you set it to..

if  ( Math.abs( random() ) % 1 <   (1 / numOfEqual ) ) {
  bestXPos = i;
}

On 11/2/06, Paul Steven <[EMAIL PROTECTED]> wrote:


Not familiar with Java code but trying to rewrite some code in Flash.
Anyone
convert this line to flash actionscript please

if (Math.abs(rand.nextInt()) % 1 <
(1 / numOfEqual))
bestXPos = i;

Thanks

Paul

___
Flashcoders@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





--

: : ) Scott
___
Flashcoders@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


Re: [Flashcoders] OT conver java code to flash

2006-11-02 Thread Mark Winterhalder

Paul,

maybe this will make your work easier:


As for the code snippet, I have no idea what 'rand' is. Other than
that, it's exactly the same in ActionScript.

Mark


On 11/2/06, Paul Steven <[EMAIL PROTECTED]> wrote:

Not familiar with Java code but trying to rewrite some code in Flash. Anyone
convert this line to flash actionscript please

if (Math.abs(rand.nextInt()) % 1 <
(1 / numOfEqual))
bestXPos = i;

Thanks

Paul

___
Flashcoders@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


___
Flashcoders@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


Re: [Flashcoders] Scaling problem while loadingexternaljpeg'sin theMovie Clip

2006-11-02 Thread Yehia Shouman

function loadImage(image){
 this.holder.loadMovie(image);
 var imageLoaded:Boolean=false;
 this.onEnterFrame = function() {
 imageLoaded=this.holder.getBytesLoaded()==
this.holder.getBytesTotal();
 if (this.holder._width>0 && this.holder._height>0 && imageLoaded)
{
 resizeHolder();
 delete this.onEnterFrame;
 }
 };
}
function resizeHolder()
{
 var aMMbasedComponentInstance:Boolean=false;
 var availableWidth:Number = aMMbasedComponentInstance? this.__width :
this._width;
 var availableHeight:Number = aMMbasedComponentInstance? this.__height :
this._height;
 //to keep scale use the following line, to strech remove the following
line
  var biggerDimension=availableWidth>availableHeight? availableWidth :
availableHeight;
  this.holder._width=availableWidth;
  this.holder._height=availableHeight;
}

all you need to do is call loadImage("someimage.jpg");

On 11/2/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:


I did not write out the entire solution because I was focusing on the
specific functionality.

When you use a holder clip, you're going to be creating it and removing
it on the fly.

this.holder.removeMovieClip();
this.createEmptyMovieClip("holder", 10);
this.holder.loadMovie("some.jpg");

Easy peasy.
___
Flashcoders@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


___
Flashcoders@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


RE: [Flashcoders] Music visualisation in Flash 9

2006-11-02 Thread Paul Steven
Haven't looked into AS3 yet but seeing this thread I wonder if it is
possible to change the pitch of dynamically loaded mp3 files in "real time"?


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin
Wood-Mitrovski
Sent: 02 November 2006 20:49
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Music visualisation in Flash 9



Jake Prime wrote:
> Hi
> 
> I have just been asked about the possibility of making an app which
> will play MP3s, and display visual effect to match it. Does this sound
> like something that is possible in AS3?

Its easy in AS3, just look up Sound.computeSpectrum in the reference.

you'll also find code examples on the internet.

such as

http://blog.andre-michelle.com/2006/soundmixercomputespectrum/

and

http://www.martijndevisser.com/blog/article/as3-computespectrum-bitmapdata


___
Flashcoders@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

___
Flashcoders@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


[Flashcoders] Getting a press for regular key...

2006-11-02 Thread eric dolecki

I have this:

var KEY_a:Number = 97;

function myOnKeyDown():Void
{
   trace( Key.isDown(Key_a));
};

var keyListener:Object = new Object();
keyListener.onKeyDown = myOnKeyDown;
Key.addListener( keyListener );

When I press the "a" key - I get a false. What is the proper shortcut code
in the myOnKeyDown to properly get the trace to return True?

- e.
___
Flashcoders@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


Re: [Flashcoders] Music visualisation in Flash 9

2006-11-02 Thread Martin Wood-Mitrovski



Paul Steven wrote:

Haven't looked into AS3 yet but seeing this thread I wonder if it is
possible to change the pitch of dynamically loaded mp3 files in "real time"?


im 99% certain the answer is no.

if there is a way i would love to know how. :)

___
Flashcoders@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


RE: [Flashcoders] Getting a press for regular key...

2006-11-02 Thread James Booth
Could it be the case of your variable?

KEY_a versus Key_a



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of eric dolecki
Sent: Thursday, November 02, 2006 8:51 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Getting a press for regular key...

I have this:

var KEY_a:Number = 97;

function myOnKeyDown():Void
{
trace( Key.isDown(Key_a));
};

var keyListener:Object = new Object();
keyListener.onKeyDown = myOnKeyDown;
Key.addListener( keyListener );

When I press the "a" key - I get a false. What is the proper shortcut code
in the myOnKeyDown to properly get the trace to return True?

- e.
___
Flashcoders@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

___
Flashcoders@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


Re: [Flashcoders] playing audio filetypes other than mp3?

2006-11-02 Thread Josh Santangelo
Yeah, I don't think I'm quite hardcore enough to write my own audio  
decoder. Plus this particular application could have a number of  
audio file formats thrown at it, so I don't think that's really a  
practical approach.


Unfortunately that's the most crucial part of this app, so if I can't  
figure a way to control an external plugin, I probably can't do it in  
Flex like I was hoping to. Sad!


-josh

On Nov 1, 2006, at 4:51p, Austin Kottke wrote:


Hey guys,

   check out: http://www.flashcodersbrighton.org/wordpress/?p=9

PCM playing in actionscript 3.

- Austin



-- Original Message ---
From: "Mike Keesey" <[EMAIL PROTECTED]>
To: "'Flashcoders mailing list'" 
Sent: Wed, 1 Nov 2006 16:16:11 -0800
Subject: RE: [Flashcoders] playing audio filetypes other than mp3?

You can use ByteArray in Flash 9 to load any kind of binary data.  
While

you could use this to create image-rendering plugins using BitmapData
(or even video-rendering, although I question performance),  
there's no
corresponding "SoundData" class, is there? So I think, at least as  
far

as sound goes, you're kind of stuck with MP3.
¯
Mike Keesey


-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Josh Santangelo
Sent: Wednesday, November 01, 2006 3:54 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] playing audio filetypes other than mp3?

I'm wondering if anyone's managed to play filetypes other than  
MP3 in

Flash. Obviously you can't just load them up, but I'm envisioning
loading them into a hidden instance of the QuickTime plugin, and  
then

using JavaScript to bridge the two so that you can control the

playback

from Flash.

Anyone seen/done anything similar?

-josh
___
Flashcoders@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


___
Flashcoders@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

--- End of Original Message ---

___
Flashcoders@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



___
Flashcoders@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


RE: [Flashcoders] Getting a press for regular key...

2006-11-02 Thread James Booth
Actually, on top of that, I think isDown checks the Key Code which would be
65.



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James Booth
Sent: Thursday, November 02, 2006 4:15 PM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] Getting a press for regular key...

Could it be the case of your variable?

KEY_a versus Key_a



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of eric dolecki
Sent: Thursday, November 02, 2006 8:51 AM
To: Flashcoders mailing list
Subject: [Flashcoders] Getting a press for regular key...

I have this:

var KEY_a:Number = 97;

function myOnKeyDown():Void
{
trace( Key.isDown(Key_a));
};

var keyListener:Object = new Object();
keyListener.onKeyDown = myOnKeyDown;
Key.addListener( keyListener );

When I press the "a" key - I get a false. What is the proper shortcut code
in the myOnKeyDown to properly get the trace to return True?

- e.
___
Flashcoders@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

___
Flashcoders@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

___
Flashcoders@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


Re: [Flashcoders] Useful Ascii codes:

2006-11-02 Thread eric dolecki

That adding property thing to the Key object doesn't work in F8 compiling
does it?

On 11/2/06, Meinte van't Kruis <[EMAIL PROTECTED]> wrote:


lol..
well, still nice of you tho :)

On 11/1/06, eric dolecki <[EMAIL PROTECTED]> wrote:
>
> Oh man... i wish i had seen that... thanks for the link!
>
> On 11/1/06, Michael Stuhr <[EMAIL PROTECTED]> wrote:
> >
> > eric dolecki schrieb:
> > > I never wanna do this again, and you probably don't either, so here
> are
> > some
> > > constants to make using ascii values of character codes more
> legible...
> > >
> > > - e.
> > >
> > > 
> > > // Constants (to make logic more readible)
> > > var KEY_EXCLAMATION:Number = 33;
> > > var KEY_DOUBLE_QUOTE:Number = 34;
> > > var KEY_POUND:Number = 35;
> > > var KEY_DOLLAR:Number = 36;
> > > var KEY_PERCENTAGE:Number = 37;
> > > var KEY_AND:Number = 38;
> > > var KEY_SINGLE_QUOTE:Number = 39;
> > > var KEY_LEFT_PAREN:Number = 40;
> > > var KEY_RIGHT_PAREN:Number = 41;
> > > var KEY_STAR:Number = 42;
> > > var KEY_PLUS:Number = 43;
> > > var KEY_COMMA:Number = 44;
> > > var KEY_MINUS:Number = 45;
> > > var KEY_PERIOD:Number = 46;
> > > var KEY_SLASH:Number = 47;
> > >
> > > var KEY_0:Number = 48;
> > > var KEY_1:Number = 49;
> > > var KEY_2:Number = 50;
> > > var KEY_3:Number = 51;
> > > var KEY_4:Number = 52;
> > > var KEY_5:Number = 53;
> > > var KEY_6:Number = 54;
> > > var KEY_7:Number = 55;
> > > var KEY_8:Number = 56;
> > > var KEY_9:Number = 57;
> > >
> > > var KEY_COLON:Number = 58;
> > > var KEY_SEMI_COLON:Number = 59;
> > > var KEY_LESS_THAN:Number = 60;
> > > var KEY_EQUAL:Number = 61;
> > > var KEY_GREATER_THAN:Number = 62;
> > > var KEY_QUESTION_MARK:Number = 63;
> > > var KEY_AT_SYMBOL:Number = 64;
> > >
> > > var KEY_A:Number = 65;var KEY_a:Number = 97;
> > > var KEY_B:Number = 66;var KEY_b:Number = 98;
> > > var KEY_C:Number = 67;var KEY_c:Number = 99;
> > > var KEY_D:Number = 68;var KEY_d:Number = 100;
> > > var KEY_E:Number = 69;var KEY_e:Number = 101;
> > > var KEY_F:Number = 70;var KEY_f:Number = 102;
> > > var KEY_G:Number = 71;var KEY_g:Number = 103;
> > > var KEY_H:Number = 72;var KEY_h:Number = 104;
> > > var KEY_I:Number = 73;var KEY_i:Number = 105;
> > > var KEY_J:Number = 74;var KEY_j:Number = 106;
> > > var KEY_K:Number = 75;var KEY_k:Number = 107;
> > > var KEY_L:Number = 76;var KEY_l:Number = 108;
> > > var KEY_M:Number = 77;var KEY_m:Number = 109;
> > > var KEY_N:Number = 78;var KEY_n:Number = 110;
> > > var KEY_O:Number = 79;var KEY_o:Number = 111;
> > > var KEY_P:Number = 80;var KEY_p:Number = 112;
> > > var KEY_Q:Number = 81;var KEY_q:Number = 113;
> > > var KEY_R:Number = 82;var KEY_r:Number = 114;
> > > var KEY_S:Number = 83;var KEY_s:Number = 115;
> > > var KEY_T:Number = 84;var KEY_t:Number = 116;
> > > var KEY_U:Number = 85;var KEY_u:Number = 117;
> > > var KEY_V:Number = 86; var KEY_v:Number = 118;
> > > var KEY_W:Number = 87;var KEY_w:Number = 119;
> > > var KEY_X:Number = 88;var KEY_x:Number = 120;
> > > var KEY_Y:Number = 89;var KEY_y:Number = 121;
> > > var KEY_Z:Number = 90;var KEY_z:Number = 122;
> > >
> > > var KEY_LEFT_BRACKET:Number = 91;
> > > var KEY_BACKSLASH:Number = 92;
> > > var KEY_RIGHT_BRACKET:Number = 93;
> > > var KEY_CARRET:Number = 94;
> > > var KEY_UNDERSCORE:Number = 95;
> > > var KEY_APOS:Number = 96;
> > > 
> > > ___
> > > Flashcoders@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
> > >
> > ahh, reminds me of:
> > http://proto.layer51.com/d.aspx?f=500
> >
> > micha
> > ___
> > Flashcoders@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
> >
> ___
> Flashcoders@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
>
___
Flashcoders@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



RE: [Flashcoders] OT conver java code to flash

2006-11-02 Thread Paul Steven
Thanks Mark

I did see that but it involves installing Eclipse and a few other things and
I have a rather tight deadline of tomorrow so didn't want to spend a few
hours working out how to use a new app. Will look into it after I finish
this though

Paul

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark
Winterhalder
Sent: 02 November 2006 20:57
To: Flashcoders mailing list
Subject: Re: [Flashcoders] OT conver java code to flash

Paul,

maybe this will make your work easier:


As for the code snippet, I have no idea what 'rand' is. Other than
that, it's exactly the same in ActionScript.

Mark


On 11/2/06, Paul Steven <[EMAIL PROTECTED]> wrote:
> Not familiar with Java code but trying to rewrite some code in Flash.
Anyone
> convert this line to flash actionscript please
>
> if (Math.abs(rand.nextInt()) % 1 <
> (1 / numOfEqual))
> bestXPos = i;
>
> Thanks
>
> Paul
>
> ___
> Flashcoders@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
>
___
Flashcoders@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

___
Flashcoders@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


Re: [Flashcoders] Q:Justifying Flash 8 Content

2006-11-02 Thread John Dowdell

Steven Sacks | BLITZ wrote:
You can still make banner ads and cartoons with Flash 4.  
That's what Flash is used for right?


So I've read ;-)

(For the main thread, people usually decide what features their 
application might need, and then balance that against the trends in 
capability among their own audience.)


jd





--
John Dowdell . Adobe Developer Support . San Francisco CA USA
Weblog: http://weblogs.macromedia.com/jd
Aggregator: http://weblogs.macromedia.com/mxna
Technotes: http://www.macromedia.com/support/
Spam killed my private email -- public record is best, thanks.
___
Flashcoders@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


RE: [Flashcoders] Music visualisation in Flash 9

2006-11-02 Thread Paul Steven
Thought as much!

I have managed to do this for a projector using Director and the tactile
xtra but I really need an online version.

Maybe AS4 will do it:)

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin
Wood-Mitrovski
Sent: 02 November 2006 21:11
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Music visualisation in Flash 9



Paul Steven wrote:
> Haven't looked into AS3 yet but seeing this thread I wonder if it is
> possible to change the pitch of dynamically loaded mp3 files in "real
time"?

im 99% certain the answer is no.

if there is a way i would love to know how. :)

___
Flashcoders@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

___
Flashcoders@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


RE: [Flashcoders] Flash Print Function and Callbacks ?

2006-11-02 Thread Merrill, Jason
>>Flash doesn't have access to the operating system on any platform.

In this particular sense of the PrintJob class, that may be true, but
there are things like the FileReference class which will allow you
limited OS access (controlled by the user) to say browse to a file,
select it, and upload it, sending you (developer) events all along the
way. 

Jason Merrill
Bank of America 
Learning & Organizational Effectiveness
 
 
 
 
 

>>-Original Message-
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ
>>Sent: Thursday, November 02, 2006 1:45 PM
>>To: Flashcoders mailing list
>>Subject: RE: [Flashcoders] Flash Print Function and Callbacks ?
>>
>>Flash doesn't have access to the operating system on any platform.
>>___
>>Flashcoders@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
___
Flashcoders@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


RE: [Flashcoders] Q:Justifying Flash 8 Content

2006-11-02 Thread Steven Sacks | BLITZ
> (For the main thread, people usually decide what features their
> application might need, and then balance that against the trends in
> capability among their own audience.)

MySpace requires Flash 9 Player, You Tube requires Flash 8 (last I
checked).  They seem to have no problems getting people to upgrade.  If
people want your content, they'll upgrade and upgrading Flash is about
as easy as it gets and almost everyone has experience with the process. 

The biggest sale points for Flash 8 are the better font readability and
higher quality video.  The biggest sale points for Flash 9 are
significant speed performance and Flex support.
___
Flashcoders@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


RE: [Flashcoders] Copy Constructor

2006-11-02 Thread Paul Steven
Perhaps it is easier if I explain what I need:

I am rewriting some Java code into AS2.

Basically I have a class called Connect4State

class Connect4State {

public function Connect4State() {

//  -
// Initialize the board array
// --

board = new Array();

code goes here


// --
// Initialize the score array
// --

score = new Array();

code goes  here
}

public var board:Array; // A 7 by 6 two dimensional array of
integers representing the state of game

public var score:Array; // A 2 dimensional array of integers
representing the "score" for the players

}

The Java code has a function called a "Copy Constructor" that enables you to
create new objects that are copies of existing objects. The copy constructor
for Connect4State just copies the contents of each member variable. It is
necessary to have a copy constructor for Connect4State because the AI
algorithms use temporary state objects a great deal

This is the "copy constructor" code translated to AS2

public function Connect4State(state:Connect4State) {

// --
// Copy the board
// --

board = new Array();

for (var i:Number = 0; i < 7; i++) {

board[i] = new Array();

for (j:Number = 0; j < 6; j++) {

board[i][j] = state.board[i][j]; 

}

}


// ---
// Copy the scores
// ---

for (var i:Number = 0; i < 2; i++) {

score = new Array();

for (var j:Number = 0; j < winPlaces; j++) {

score[i][j] = state.score[i][j]; 
numPieces = state.numPieces;
} 

}


}

AS2 seems not to like this as I get the following error

A class must have only one constructor.
public function Connect4State(state:Connect4State)

Anyone suggest an alternative to this "Copy Constructor"?





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Steven
Sent: 02 November 2006 20:01
To: 'Flashcoders mailing list'
Subject: [Flashcoders] Copy Constructor

Hi there 

Is there an equivalent of the Java Copy constructor in Flash AS2?

Thanks

Paul

___
Flashcoders@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

___
Flashcoders@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


RE: [Flashcoders] playing audio filetypes other than mp3?

2006-11-02 Thread Mark R. Jonkman
Hi Josh

Assuming that you can actually control the qt plugin itself using
Javascript, then you should be able to do everything you are asking by
simply using ExternalInterface or whatever the Flash 9 (AS3) equivalent is
to talk bidirectionally between Flash and JavaScript in the webpage. 

Sincerely
Mark R. Jonkman 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Josh Santangelo
> Sent: Thursday, November 02, 2006 9:02 AM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] playing audio filetypes other than mp3?
> 
> Yeah, I don't think I'm quite hardcore enough to write my own 
> audio decoder. Plus this particular application could have a 
> number of audio file formats thrown at it, so I don't think 
> that's really a practical approach.
> 
> Unfortunately that's the most crucial part of this app, so if 
> I can't figure a way to control an external plugin, I 
> probably can't do it in Flex like I was hoping to. Sad!
> 
> -josh
> 
> On Nov 1, 2006, at 4:51p, Austin Kottke wrote:
> 
> > Hey guys,
> >
> >check out: http://www.flashcodersbrighton.org/wordpress/?p=9
> >
> > PCM playing in actionscript 3.
> >
> > - Austin
> >
> >
> >
> > -- Original Message ---
> > From: "Mike Keesey" <[EMAIL PROTECTED]>
> > To: "'Flashcoders mailing list'" 
> > Sent: Wed, 1 Nov 2006 16:16:11 -0800
> > Subject: RE: [Flashcoders] playing audio filetypes other than mp3?
> >
> >> You can use ByteArray in Flash 9 to load any kind of binary data.  
> >> While
> >> you could use this to create image-rendering plugins using 
> BitmapData 
> >> (or even video-rendering, although I question 
> performance), there's 
> >> no corresponding "SoundData" class, is there? So I think, 
> at least as 
> >> far as sound goes, you're kind of stuck with MP3.
> >> ¯
> >> Mike Keesey
> >>
> >>> -Original Message-
> >>> From: [EMAIL PROTECTED] 
> [mailto:flashcoders- 
> >>> [EMAIL PROTECTED] On Behalf Of Josh Santangelo
> >>> Sent: Wednesday, November 01, 2006 3:54 PM
> >>> To: flashcoders@chattyfig.figleaf.com
> >>> Subject: [Flashcoders] playing audio filetypes other than mp3?
> >>>
> >>> I'm wondering if anyone's managed to play filetypes other than
> >>> MP3 in
> >>> Flash. Obviously you can't just load them up, but I'm envisioning 
> >>> loading them into a hidden instance of the QuickTime plugin, and 
> >>> then using JavaScript to bridge the two so that you can 
> control the
> >> playback
> >>> from Flash.
> >>>
> >>> Anyone seen/done anything similar?
> >>>
> >>> -josh
> >>> ___
> >>> Flashcoders@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
> >>
> >> ___
> >> Flashcoders@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
> > --- End of Original Message ---
> >
> > ___
> > Flashcoders@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
> >
> 
> ___
> Flashcoders@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
> 


___
Flashcoders@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


RE: [Flashcoders] OT conver java code to flash

2006-11-02 Thread jim
Which version of actionscript? And in whats the context? 

The only thing that dosnt look like it will directlty port over is the
rand.nextInt() but you can use Math.rand() the rest is basic maths stuff you
can do in actionscript.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Steven
Sent: 02 November 2006 17:15
To: 'Flashcoders mailing list'
Subject: [Flashcoders] OT conver java code to flash

Not familiar with Java code but trying to rewrite some code in Flash. Anyone
convert this line to flash actionscript please

if (Math.abs(rand.nextInt()) % 1 <
(1 / numOfEqual)) 
bestXPos = i;

Thanks

Paul

___
Flashcoders@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

___
Flashcoders@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


RE: [Flashcoders] Copy Constructor

2006-11-02 Thread Mike Keesey
I might do it like this:

class mypackage.Connect4State extends Object {
public function Connect4State(state:Connect4State) {
super();
if (state instanceof Connect4State) {
copy(state);
} else {
board = new Array();
score = new Array();
// Default initialization code.
}
}
public function copy(state:Connect4State):Void {
board = state.board.concat();
score = state.score.concat();
}
public var board:Array;
public var score:Array;
}

Then you could call the construct with or without a parameter.

(Actually, I would never use public variables, but that's another
topic)
―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Paul Steven
> Sent: Thursday, November 02, 2006 2:31 PM
> To: 'Flashcoders mailing list'
> Subject: RE: [Flashcoders] Copy Constructor
> 
> Perhaps it is easier if I explain what I need:
> 
> I am rewriting some Java code into AS2.
> 
> Basically I have a class called Connect4State
> 
> class Connect4State {
> 
>   public function Connect4State() {
> 
>   //  -
>   // Initialize the board array
>   // --
> 
>   board = new Array();
> 
>   code goes here
> 
> 
>   // --
>   // Initialize the score array
>   // --
> 
>   score = new Array();
> 
>   code goes  here
>   }
> 
>   public var board:Array; // A 7 by 6 two dimensional array of
> integers representing the state of game
> 
>   public var score:Array; // A 2 dimensional array of integers
> representing the "score" for the players
> 
> }
> 
> The Java code has a function called a "Copy Constructor" that enables
you
> to
> create new objects that are copies of existing objects. The copy
> constructor
> for Connect4State just copies the contents of each member variable. It
is
> necessary to have a copy constructor for Connect4State because the AI
> algorithms use temporary state objects a great deal
> 
> This is the "copy constructor" code translated to AS2
> 
>   public function Connect4State(state:Connect4State) {
> 
>   // --
>   // Copy the board
>   // --
> 
>   board = new Array();
> 
>   for (var i:Number = 0; i < 7; i++) {
> 
>   board[i] = new Array();
> 
>   for (j:Number = 0; j < 6; j++) {
> 
>   board[i][j] = state.board[i][j];
> 
>   }
> 
>   }
> 
> 
>   // ---
>   // Copy the scores
>   // ---
> 
>   for (var i:Number = 0; i < 2; i++) {
> 
>   score = new Array();
> 
>   for (var j:Number = 0; j < winPlaces; j++) {
> 
>   score[i][j] = state.score[i][j];
>   numPieces = state.numPieces;
>   }
> 
>   }
> 
> 
>   }
> 
> AS2 seems not to like this as I get the following error
> 
> A class must have only one constructor.
>   public function Connect4State(state:Connect4State)
> 
> Anyone suggest an alternative to this "Copy Constructor"?
> 
> 
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Paul
> Steven
> Sent: 02 November 2006 20:01
> To: 'Flashcoders mailing list'
> Subject: [Flashcoders] Copy Constructor
> 
> Hi there
> 
> Is there an equivalent of the Java Copy constructor in Flash AS2?
> 
> Thanks
> 
> Paul
> 
> ___
> Flashcoders@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
> 
> ___
> Flashcoders@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

___
Flashcoders@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

RE: [Flashcoders] Copy Constructor

2006-11-02 Thread Steven Sacks | BLITZ
How about this?

class Test {
var foo:String;
var bar:String;
function Test(initObj:Object) {
for (var a:String in initObj) {
this[a] = initObj[a];
}
}
public function get data():Object {
var obj:Object = {};
obj.foo = foo;
obj.bar = bar;
return obj;
}
public function copyConstructor():Test {
return new Test(data);
}
}



//

import Test;
test1 = new Test();
test1.foo = "Hello";
test1.bar = "World";
test2 = test1.copyConstructor();
trace(test2.foo);
trace(test2.bar);
-- Hello
-- World
___
Flashcoders@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


RE: [Flashcoders] OT conver java code to flash

2006-11-02 Thread Paul Steven
Thanks Jim

It is AS2, and the context is below. Btw what is the difference between
Math.rand() and Math.random()?

// ---
// If two moves are equally good, make a random choice
// ---

if (goodness == bestWorst) {

  numOfEqual++;

  if (Math.abs(rand.nextInt()) % 1 < (1 / numOfEqual)) {

bestXPos = i; 

}

}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of jim
Sent: 02 November 2006 22:50
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] OT conver java code to flash

Which version of actionscript? And in whats the context? 

The only thing that dosnt look like it will directlty port over is the
rand.nextInt() but you can use Math.rand() the rest is basic maths stuff you
can do in actionscript.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Steven
Sent: 02 November 2006 17:15
To: 'Flashcoders mailing list'
Subject: [Flashcoders] OT conver java code to flash

Not familiar with Java code but trying to rewrite some code in Flash. Anyone
convert this line to flash actionscript please

if (Math.abs(rand.nextInt()) % 1 <
(1 / numOfEqual)) 
bestXPos = i;

Thanks

Paul

___
Flashcoders@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

___
Flashcoders@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

___
Flashcoders@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


RE: [Flashcoders] Copy Constructor

2006-11-02 Thread Mike Keesey
Maybe I'm not quite getting the concept, but a "copy constructor" should
be a constructor that copies data from another object to the object
being created, right? And (I think) the original poster wanted to know
how to overload constructors in ActionScript so as to have a default
(argument-less) constructor and a copy constructor.

But you can't overload functions in ActionScript. You only get one form
for each method/constructor. But you can make the argument(s) optional,
which is what I did in my example, posted earlier.

In AS3.0, I think the constructor might look more like this:

// ...
function ClassName(source:* = null) {
super();
// ...
if (source is ClassName) {
copy(ClassName(source))
} else {
// Default initialization.
}
}
public function copy(source:ClassName):void {
// Copy data from source to this object.
}
/...

Example of code using this class:

var a:ClassName = new ClassName(); // Default initialization.
// Code that modifies a.
var b:ClassName = new ClassName(a); // Creates a copy of a.

Another possibility is to create a clone() method:

// ...
public function clone():ClassName {
var cloneObj:ClassName = new ClassName();
cloneObj.copy(this);
return cloneObj;
}
// ...

―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ
> Sent: Thursday, November 02, 2006 2:53 PM
> To: Flashcoders mailing list
> Subject: RE: [Flashcoders] Copy Constructor
> 
> How about this?
> 
> class Test {
>   var foo:String;
>   var bar:String;
>   function Test(initObj:Object) {
>   for (var a:String in initObj) {
>   this[a] = initObj[a];
>   }
>   }
>   public function get data():Object {
>   var obj:Object = {};
>   obj.foo = foo;
>   obj.bar = bar;
>   return obj;
>   }
>   public function copyConstructor():Test {
>   return new Test(data);
>   }
> }
> 
> 
> 
> //
> 
> import Test;
> test1 = new Test();
> test1.foo = "Hello";
> test1.bar = "World";
> test2 = test1.copyConstructor();
> trace(test2.foo);
> trace(test2.bar);
> -- Hello
> -- World
> ___
> Flashcoders@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

___
Flashcoders@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


[Flashcoders] Streaming video issue

2006-11-02 Thread bruce
Hi,

I'm trying to stream videos off an FMS account with Influxis!
Since I'm new at this I was looking for some tutorials and came across this 
one: http://www.adobe.com/devnet/flash/articles/video_player.html. I just need 
to integrate this into my application which plays local and progressive video 
just fine. But I can't get any of the videos to stream?! I tried using 
everything as is in the tutorials but it still doesn't work! I followed 
everything step by step and it all seems to be alright.
I've created the application folders, etc. and put in all the necessary files 
in the correct place. The thumbnails show up  but the video doesn't play when I 
click on the thumbnails. I'm slammed...can some one help me out and tell me 
where I'm going wrong!?!?! The test page is here: 
http://www.bruzed.com/rtmptest/VideoSource2.html.

Thanks in advance!
Bruce.

___
Flashcoders@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

RE: [Flashcoders] Copy Constructor

2006-11-02 Thread Paul Steven
Thanks a million Mike, that works perfectly. I now have a chance of getting
this game up and running by the morning.

One question though. I commented out the super(); after reading the
following: 

The super() call in the constructor class is not required because Flash
handles this for you in AS2, and it is handled properly. In AS1 you had to
call super() to make sure the superclass' constructor was called. The order
for class initialization tended to be a bit odd. That is not the case in
AS2.

I am fairly new to AS2 so I do not really understand what super() does but
its all working fine so far as far as I can see. 

Can you comment on whether the super() is required?

Thanks

Paul



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Keesey
Sent: 02 November 2006 22:53
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] Copy Constructor

I might do it like this:

class mypackage.Connect4State extends Object {
public function Connect4State(state:Connect4State) {
super();
if (state instanceof Connect4State) {
copy(state);
} else {
board = new Array();
score = new Array();
// Default initialization code.
}
}
public function copy(state:Connect4State):Void {
board = state.board.concat();
score = state.score.concat();
}
public var board:Array;
public var score:Array;
}

Then you could call the construct with or without a parameter.

(Actually, I would never use public variables, but that's another
topic)
―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Paul Steven
> Sent: Thursday, November 02, 2006 2:31 PM
> To: 'Flashcoders mailing list'
> Subject: RE: [Flashcoders] Copy Constructor
> 
> Perhaps it is easier if I explain what I need:
> 
> I am rewriting some Java code into AS2.
> 
> Basically I have a class called Connect4State
> 
> class Connect4State {
> 
>   public function Connect4State() {
> 
>   //  -
>   // Initialize the board array
>   // --
> 
>   board = new Array();
> 
>   code goes here
> 
> 
>   // --
>   // Initialize the score array
>   // --
> 
>   score = new Array();
> 
>   code goes  here
>   }
> 
>   public var board:Array; // A 7 by 6 two dimensional array of
> integers representing the state of game
> 
>   public var score:Array; // A 2 dimensional array of integers
> representing the "score" for the players
> 
> }
> 
> The Java code has a function called a "Copy Constructor" that enables
you
> to
> create new objects that are copies of existing objects. The copy
> constructor
> for Connect4State just copies the contents of each member variable. It
is
> necessary to have a copy constructor for Connect4State because the AI
> algorithms use temporary state objects a great deal
> 
> This is the "copy constructor" code translated to AS2
> 
>   public function Connect4State(state:Connect4State) {
> 
>   // --
>   // Copy the board
>   // --
> 
>   board = new Array();
> 
>   for (var i:Number = 0; i < 7; i++) {
> 
>   board[i] = new Array();
> 
>   for (j:Number = 0; j < 6; j++) {
> 
>   board[i][j] = state.board[i][j];
> 
>   }
> 
>   }
> 
> 
>   // ---
>   // Copy the scores
>   // ---
> 
>   for (var i:Number = 0; i < 2; i++) {
> 
>   score = new Array();
> 
>   for (var j:Number = 0; j < winPlaces; j++) {
> 
>   score[i][j] = state.score[i][j];
>   numPieces = state.numPieces;
>   }
> 
>   }
> 
> 
>   }
> 
> AS2 seems not to like this as I get the following error
> 
> A class must have only one constructor.
>   public function Connect4State(state:Connect4State)
> 
> Anyone suggest an alternative to this "Copy Constructor"?
> 
> 
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Paul
> Steven
> Sent: 02 November 2006 20:01
> To: 'Flashcoders mailing list'
> Subject: [Flashcoders] Copy Constructor
> 
> Hi there
> 
> Is there an equivalent of the Java Copy constructor in Flash AS2?
> 
> Thanks
> 
> Paul
> 
> ___
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive

[Flashcoders] terminating hotspots etc

2006-11-02 Thread :: joshua

hey everyone.

ok heres the situation:

i have a flash site that I would like to terminate all functionality  
to when a "help" panel comes up.

essentially shutting off all hotspots and motion mc's.

would there happen to be an "easy" way to make this happen...

im afraid i know the answer to this[hoping i'm wrong]...but that's  
why i'm turning to you all...



cheers.

joshua

___
Flashcoders@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


RE: [Flashcoders] Copy Constructor

2006-11-02 Thread Mike Keesey
A call to super() is not required unless you are passing arguments to
the superclass' constructor. Nor is it required that you specify that
you are extending Object. (If you don't specify a superclass, it assumes
Object.) I just do it that way because I'm anal about my code. ;)

Calling super() calls the constructor of the superclass (i.e, parent
class). One instance where you might need it is if the constructor
signatures do not match, e.g.:

class SuperClass extends Object {
public function SuperClass(superValue:Number) {
_superField = superValue;
}
public function get superField():Number {
return _superField;
}
private var _superField:Number;
}

class SubClass extends SuperClass {
public function SuperClass(superValue:Number, subValue:Number) {
super(superValue);
_subField = subValue;
}
public function get subField():Number {
return _subField;
}
private var _subField:Number;
}

The super keyword can also be used to access fields and methods of the
superclass, e.g. where methods have been overridden in the subclass,
e.g.:

public function toString():String {
return super.toString() + " extra subclass info";
}

―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Paul Steven
> Sent: Thursday, November 02, 2006 4:03 PM
> To: 'Flashcoders mailing list'
> Subject: RE: [Flashcoders] Copy Constructor
> 
> Thanks a million Mike, that works perfectly. I now have a chance of
> getting
> this game up and running by the morning.
> 
> One question though. I commented out the super(); after reading the
> following:
> 
> The super() call in the constructor class is not required because
Flash
> handles this for you in AS2, and it is handled properly. In AS1 you
had to
> call super() to make sure the superclass' constructor was called. The
> order
> for class initialization tended to be a bit odd. That is not the case
in
> AS2.
> 
> I am fairly new to AS2 so I do not really understand what super() does
but
> its all working fine so far as far as I can see.
> 
> Can you comment on whether the super() is required?
> 
> Thanks
> 
> Paul
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike
> Keesey
> Sent: 02 November 2006 22:53
> To: 'Flashcoders mailing list'
> Subject: RE: [Flashcoders] Copy Constructor
> 
> I might do it like this:
> 
> class mypackage.Connect4State extends Object {
>   public function Connect4State(state:Connect4State) {
>   super();
>   if (state instanceof Connect4State) {
>   copy(state);
>   } else {
>   board = new Array();
>   score = new Array();
>   // Default initialization code.
>   }
>   }
>   public function copy(state:Connect4State):Void {
>   board = state.board.concat();
>   score = state.score.concat();
>   }
>   public var board:Array;
>   public var score:Array;
> }
> 
> Then you could call the construct with or without a parameter.
> 
> (Actually, I would never use public variables, but that's another
> topic)
> ―
> Mike Keesey
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:flashcoders-
> > [EMAIL PROTECTED] On Behalf Of Paul Steven
> > Sent: Thursday, November 02, 2006 2:31 PM
> > To: 'Flashcoders mailing list'
> > Subject: RE: [Flashcoders] Copy Constructor
> >
> > Perhaps it is easier if I explain what I need:
> >
> > I am rewriting some Java code into AS2.
> >
> > Basically I have a class called Connect4State
> >
> > class Connect4State {
> >
> > public function Connect4State() {
> >
> > //  -
> > // Initialize the board array
> > // --
> >
> > board = new Array();
> >
> > code goes here
> >
> >
> > // --
> > // Initialize the score array
> > // --
> >
> > score = new Array();
> >
> > code goes  here
> > }
> >
> > public var board:Array; // A 7 by 6 two dimensional array of
> > integers representing the state of game
> >
> > public var score:Array; // A 2 dimensional array of integers
> > representing the "score" for the players
> >
> > }
> >
> > The Java code has a function called a "Copy Constructor" that
enables
> you
> > to
> > create new objects that are copies of existing objects. The copy
> > constructor
> > for Connect4State just copies the contents of each member variable.
It
> is
> > necessary to have a copy constructor for Connect4State because the
AI
> > algorithms use temporary state objects a great deal
> >
> > This is the "copy constructor" code tr

RE: [Flashcoders] terminating hotspots etc

2006-11-02 Thread Mike Keesey
Well, the easiest way to shut off all hotspots (and it's kind of a hack,
but a pretty useful one) is to throw a big, invisible button with
property useHandCursor set to false over everything.

That won't work for motion, though. For motion the most elegant solution
is probably to use a singleton EventDispatcher to control everything:

// MotionDispatcher class
import mx.events.EventDispatcher;
[Event("start")]
[Event("stop")]
function mypackage.MotionController extends EventDispatcher {
private function MotionDispatcher() {
super();
}
public static function get instance():MotionController {
if (_instance == undefined) {
_instance = new MotionController();
}
return _instance;
}
public function get stopped():Boolean {
return _stopped;
}
public function set stopped(value:Boolean):Void {
if (_stopped != Boolean(value)) {
_stopped = Boolean(value);
dispatchEvent({type: _stopped ? "stop" :
"start", target: this});
}
}
private static var _instance:MotionController;
private var _stopped:Boolean = false;
}

// In a motion-controlled movieclip with a timeline animation:
import mx.utils.Delegate;
MotionController.instance.addEventListener("start",
Delegate.create(this, play));
MotionController.instance.addEventListener("stop", Delegate.create(this,
stop));

// To stop all controlled animations:
MotionController.instance.stopped = true; 

// To restart all controlled animations:
MotionController.instance.stopped = false;

―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of :: joshua
> Sent: Thursday, November 02, 2006 4:27 PM
> To: Flashcoders@chattyfig.figleaf.com
> Subject: [Flashcoders] terminating hotspots etc
> 
> hey everyone.
> 
> ok heres the situation:
> 
> i have a flash site that I would like to terminate all functionality
> to when a "help" panel comes up.
> essentially shutting off all hotspots and motion mc's.
> 
> would there happen to be an "easy" way to make this happen...
> 
> im afraid i know the answer to this[hoping i'm wrong]...but that's
> why i'm turning to you all...
> 
> 
> cheers.
> 
> joshua
> 
> ___
> Flashcoders@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

___
Flashcoders@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


RE: [Flashcoders] OT conver java code to flash

2006-11-02 Thread Mike Keesey
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Paul Steven
> Sent: Thursday, November 02, 2006 3:15 PM
> To: 'Flashcoders mailing list'
> Subject: RE: [Flashcoders] OT conver java code to flash
> 
> Thanks Jim
> 
> It is AS2, and the context is below. Btw what is the difference
between
> Math.rand() and Math.random()?

There is no Math.rand(). There was a top-level function, random(), which
returned integers (I think), but it is deprecated. Just use
Math.random():

var MAX:Number = [some positive integer value];
var randomInt:Number = Math.floor(MAX * Math.random()); // Sets it to
some number from 0 to MAX - 1.

―
Mike Keesey



___
Flashcoders@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


[Flashcoders] Recommended encoding rates for FLV?

2006-11-02 Thread Reuben Stanton
I'm after some recommendations for encoding FLV files - we'll be  
delivering for two connections speeds - 256k and 1mb, in a you-tube  
style interface.


 What would the list recommend as the ideal kbps, audio data rate,  
codec ect? I'm pretty new to flash video.

___
Flashcoders@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


[Flashcoders] Recommended encoding rates for FLV?

2006-11-02 Thread Bjorn Schultheiss
This man is an authority on the issue.
http://flashvideo.progettosinergia.com/


Regards,
 
Bjorn Schultheiss


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Reuben
Stanton
Sent: Friday, 3 November 2006 2:19 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Recommended encoding rates for FLV?

I'm after some recommendations for encoding FLV files - we'll be  
delivering for two connections speeds - 256k and 1mb, in a you-tube  
style interface.

  What would the list recommend as the ideal kbps, audio data rate,  
codec ect? I'm pretty new to flash video.
___
Flashcoders@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
___
Flashcoders@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


[Flashcoders] Tween question

2006-11-02 Thread Mike O'Grady

Hi,

I've got a motion tween in the timeline that simply moves a mc
vertically (about 30 pixels) and then back again.

All works fine until I also try to move that mc horizontally using
actionscript and the ._x property, the timeline motion tween stops
working, the mc moves horizontally but not vertically.

Is this just Flash's normal behavior, that moving an object using
actionscript means that the timeline will be ignored? Are there any
work arounds?

Thanks,
Mike
___
Flashcoders@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


[Flashcoders] Extending MovieClip without touching the Library

2006-11-02 Thread Trevor Burton
Morning List!

 

I've been asked to take a look at this:

 

http://osflash.org/flashcoders/as2#creating_a_class_instance_based_on_moviec
lip_without_a_symbol_in_the_library

 

and find out whether:

 

"the suggested implementation in the link is not a "hack" that relies on a
bug in the Flash plug-in and is a genuine solution that will serve us
through any future plug-ins."

 

Does anyone know if this is a 'hack' and will be stable in future. Although
I'm thinking that future plug-ins are going to be focusing on compiling AS3
and the current virtual machine will remain unchanged so not affecting the
functionality of this trick. Would be great to know for sure though.

 

T

 

 

 

___
Flashcoders@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


Re: [Flashcoders] Extending MovieClip without touching the Library

2006-11-02 Thread Peter Hall

This trick came from my blog post a couple of years ago:
http://www.peterjoel.com/blog/?archive=2004_01_01_archive.xml

It is stable in the future because it relies on the Flash Authoring
compiler, and not on anything in the player. AS2 compiling won't be
changing ever - and even if it does, you can always just keep
compiling with Flash 8.

Of course it won't work withAS3, but that's not exactly necessary...

Peter


On 11/2/06, Trevor Burton <[EMAIL PROTECTED]> wrote:

Morning List!



I've been asked to take a look at this:



http://osflash.org/flashcoders/as2#creating_a_class_instance_based_on_moviec
lip_without_a_symbol_in_the_library



and find out whether:



"the suggested implementation in the link is not a "hack" that relies on a
bug in the Flash plug-in and is a genuine solution that will serve us
through any future plug-ins."



Does anyone know if this is a 'hack' and will be stable in future. Although
I'm thinking that future plug-ins are going to be focusing on compiling AS3
and the current virtual machine will remain unchanged so not affecting the
functionality of this trick. Would be great to know for sure though.



T







___
Flashcoders@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


___
Flashcoders@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


Re: [Flashcoders] Tween question

2006-11-02 Thread Zeh Fernando

All works fine until I also try to move that mc horizontally using
actionscript and the ._x property, the timeline motion tween stops
working, the mc moves horizontally but not vertically.
Is this just Flash's normal behavior, that moving an object using
actionscript means that the timeline will be ignored? Are there any
work arounds?


Yes, it is. It stops updating the object with timeline's properties if you 
change them dynamically.


There's one workaround: create another inner movieclip and change the _x of 
that inner movieclip. That way, changes to the timeline and the dynamic 
property will "stack" to each other.


I'd recommend stop using the timeline and always use code animation though. 
It's much bettter in almost all cases, the only exception being guided 
animation.



Zeh 


___
Flashcoders@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


Re: [Flashcoders] terminating hotspots etc

2006-11-02 Thread :: joshua

hey mike.

gonna sit with it and give it a whirl...see what i can make of it.

appreciate the help...fingers crossed.


cheers.

joshua forstot


On Nov 2, 2006, at 4:39 PM, Mike Keesey wrote:

Well, the easiest way to shut off all hotspots (and it's kind of a  
hack,

but a pretty useful one) is to throw a big, invisible button with
property useHandCursor set to false over everything.

That won't work for motion, though. For motion the most elegant  
solution

is probably to use a singleton EventDispatcher to control everything:

// MotionDispatcher class
import mx.events.EventDispatcher;
[Event("start")]
[Event("stop")]
function mypackage.MotionController extends EventDispatcher {
private function MotionDispatcher() {
super();
}
public static function get instance():MotionController {
if (_instance == undefined) {
_instance = new MotionController();
}
return _instance;
}
public function get stopped():Boolean {
return _stopped;
}
public function set stopped(value:Boolean):Void {
if (_stopped != Boolean(value)) {
_stopped = Boolean(value);
dispatchEvent({type: _stopped ? "stop" :
"start", target: this});
}
}
private static var _instance:MotionController;
private var _stopped:Boolean = false;
}

// In a motion-controlled movieclip with a timeline animation:
import mx.utils.Delegate;
MotionController.instance.addEventListener("start",
Delegate.create(this, play));
MotionController.instance.addEventListener("stop", Delegate.create 
(this,

stop));

// To stop all controlled animations:
MotionController.instance.stopped = true;

// To restart all controlled animations:
MotionController.instance.stopped = false;

―
Mike Keesey


-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of :: joshua
Sent: Thursday, November 02, 2006 4:27 PM
To: Flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] terminating hotspots etc

hey everyone.

ok heres the situation:

i have a flash site that I would like to terminate all functionality
to when a "help" panel comes up.
essentially shutting off all hotspots and motion mc's.

would there happen to be an "easy" way to make this happen...

im afraid i know the answer to this[hoping i'm wrong]...but that's
why i'm turning to you all...


cheers.

joshua

___
Flashcoders@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


___
Flashcoders@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


___
Flashcoders@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


Re: [Flashcoders] Tween question

2006-11-02 Thread Hans Wichman

Hi,
there is another workaround, although i'd not recommend it, but knowing the
trick involved might be nice though:).

You can 'record' all the movieclips positions in array, by visiting each
frame in the first frame.
In other words, in a single onEnterFrame (the first prob), you could
gotoAndStop to each and everyframe, to record whats there.
You can use this data to play back similar or altered movements on the same
clips through code.

greetz
JC


On 11/3/06, Zeh Fernando <[EMAIL PROTECTED]> wrote:


> All works fine until I also try to move that mc horizontally using
> actionscript and the ._x property, the timeline motion tween stops
> working, the mc moves horizontally but not vertically.
> Is this just Flash's normal behavior, that moving an object using
> actionscript means that the timeline will be ignored? Are there any
> work arounds?

Yes, it is. It stops updating the object with timeline's properties if you
change them dynamically.

There's one workaround: create another inner movieclip and change the _x
of
that inner movieclip. That way, changes to the timeline and the dynamic
property will "stack" to each other.

I'd recommend stop using the timeline and always use code animation
though.
It's much bettter in almost all cases, the only exception being guided
animation.


Zeh

___
Flashcoders@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


___
Flashcoders@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


[Flashcoders] Url query-string in Actionscript 3 (Flash 9 Public Alpha)

2006-11-02 Thread Carl Welch

Hi,

I am trying to send an URL query string to AS 3:

heres the string:
http://..xxx/track_visualizer.php?process=foo.mp3&myTable=bar


I found this example (12th item down):
http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/

Now, I suck at using classes (at the moment) and would just like to
put it in the frame with the rest of my script. I've tried to widdle
it down but keep getting errors. Can someone point me in the right
direction?

--
Carl Welch
http://www.carlwelch.com
[EMAIL PROTECTED]
805.403.4819
___
Flashcoders@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


[Flashcoders] Url query-string in Actionscript 3 (Flash 9 Public Alpha)

2006-11-02 Thread Carl Welch

Hi,

I am trying to send an URL query string to AS 3:

heres the string:
http://someurl/track_visualizer.php?process=foo.mp3&myTable=bar


I found this example (12th item down):
http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/

Now, I suck at using classes (at the moment) and would just like to
put it in the frame with the rest of my script. I've tried to widdle
it down but keep getting errors. Can someone point me in the right
direction?

--
Carl Welch
http://www.carlwelch.com
[EMAIL PROTECTED]
805.403.4819
___
Flashcoders@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