Re: [Flashcoders] How does this thing work

2008-04-21 Thread Matthew Houliston

On 22/04/2008 00:17, PIXELTHEORY.LA | RYAN PIERCE wrote:
I am new to this and am trying to figure this thing out, can you give  
me a some direction?



http://users.aristotle.net/~diogenes/meaning1.htm
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Is Adobe fixing this big FP9 problem?

2008-04-15 Thread Matthew Houliston

On 15/04/2008 15:35, Pete Hotchkiss wrote:

People please - can we keep this thing ON TOPIC !!!


Indeed.

My understanding is that only SWFs loaded from the same domain are 
affected - those loaded from an external domain or a subdomain are 
protected by an implicit sandbox. So while they can't be unloaded, 
they are at least unaffected by the player bug and will be cleaned up 
by the garbage collector.


Is this correct?


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


Re: [Flashcoders] Re: Adding n days to dateField.selectedDate

2008-04-14 Thread Matthew Houliston

On 15/04/2008 03:15, Alan Neilsen wrote:


I get an error that there is no property with the name 'time' referring to 
'd.time+=(8640*283).


Date.time is an AS3 property - didn't realise you were in AS2.

This should work:

var d:Date=new Date(2008,3,14);
d.setTime(d.getTime()+(8640*283)); // 283 days, in milliseconds
trace(d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate());
// 2009/1/21
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Adding n days to dateField.selectedDate

2008-04-13 Thread Matthew Houliston

On 14/04/2008 01:34, Gabino Travassos wrote:

If I want 283 days in the future I add 1208129349 + (283 days *24 hours*60 
minutes*60second) = 1232580549 and I convert that to whatever date format I 
want.


Gabino's right, and the Date class makes it easy :

var d:Date=new Date(2008,3,14);
d.time+=(8640*283); // 283 days, in milliseconds
trace(d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate());
// 2009/1/21
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Testing online and offline

2008-03-19 Thread Matthew Houliston

On 19/03/2008 20:28, Helmut Granda wrote:


I started testing the ApplicationDomain and
ApplicationDomain.currentDomain but that still turns undefined off line and
online...

// just for testing purposes:
import flash.system.ApplicationDomain;
this.applicationDomain = ApplicationDomain.currentDomain
trace(this.currentDomain );



ApplicationDomain isn't related to the server hostname - it's for 
managing classes in external swf files.


You can get the current hosting address with
trace(root.loaderInfo.loaderURL);


Even better, IMO, you can check system.Capabilities.playerType to see 
if it's running locally:


import flash.system.Capabilities;

trace(Capabilities.playerType); // 'External', when running in the IDE



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


Re: [Flashcoders] 9-slice scaling not working when used as mask

2008-03-13 Thread Matthew Houliston

On 13/03/2008 15:15, Martin Klasson wrote:


I am not that good ar the drawing api to be making myself some great corners
;)



import flash.display.Shape;

var my_mask:Shape=new Shape();
my_mask.graphics.beginFill(0x99, 1);
my_mask.graphics.drawRoundRect(10,10,320,240,15);
my_mask.graphics.endFill();
addChild(my_mask);


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


Re: [Flashcoders] [AS3] optional parameters - sans defaults for Boolean/Number/int

2008-02-29 Thread Matthew Houliston

don't you mean

function test2 ( a:Boolean = false )
{
trace( "a: " + ( a == true ) );
}

?


A Boolean is never null.

var b:Boolean;
trace(b);



On 29/02/2008 10:42, Jesse Graupmann wrote:

I'm trying to create typed functions using optional parameters sans the
defaults. I'm finding String to be the only thing that allows for null to be
passed. Is there a way to extend that functionality to other types like;
Numbers, Booleans, and/or ints?

NOTE : I am aware of ...rest and passing an object like what's used in
Tweener but that hides too much.


Thanks in advance,
Jesse



//  EXPECTED


	function test ( a:String = null ) 
	{

trace( "test: " + ( a == null ) );
}

test ( "test" ); // false
test ( ); // true <--- GOOD




//  UNFORTUNATE


	function test2 ( a:Boolean = false ) 
	{

trace( "a: " + ( a == null ) );
}
test2 ( true ); // false
test2 ( false ); // false
test2 ( ); // false <--- BAD



//  IDEAL


function test4 ( b:Boolean = null )
{
trace( b==null );
}

function test5 ( n:Number = null )
{
trace( isNaN(n) );
}

	function test6 ( i:int = null ) 
	{

trace( isNaN(i) );
}

test4 ( ); // true <--- DESIRED
test5 ( ); // true <--- DESIRED
test6 ( ); // true <--- DESIRED



//  CURRENT WORK AROUND -- ONLY WORKS WHEN NEEDING POSITIVES


	function test7 ( w:Number = -1, h:Number = -1 ) 
	{

trace( (w < 0 || h < 0) );
}

test7 (10, 10); // false
test7 (10); // true
test7 (); // true

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



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


Re: [flashcoders] copy to clipboard

2008-02-18 Thread Matthew Houliston

On 18/02/2008 16:16, laurent wrote:

Is it possible to copy a string to the clipboard with actionScript 3 or 
is it only available from Flex ?


import flash.system.System;

System.setClipboard("some text");


There's no System.getClipboard(). Write only.


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