[Flashcoders] PHP Socket Question

2009-07-22 Thread Omar Fouad
hey,
My boss asked me to develop a Cards Game called Estimation (I don't know
if you heard about it). It is a Cards game similar to spades, where there
are tricks, bids, etc.
The game is going to be a Facebook application, so it is required a
multi-player option (real time).
At first I thought I would create a database and continuously let the client
send queries using AMF, to check for changes and update the display. But a
friend of mine told me this is insane. The data on the database he would
buge, and I have to take in mind, that anyone could leave the game at
anytime, so the data will remain in the database uselessly. He told me to
use sockets, and store the variables I need, such as the rooms, the player
nickname, the bids, the calls, the tricks, the scores, the rounds, the
hands, and all the crap that I would need in the server side script (PHP).
Is this true? If I will have to use sockets, should I store the data as
variables in the server side script?

I really need to figure out how to start. Thanks.

-- 
Omar M. Fouad - Adobe™ Flash© Platform Developer
www.omar-fouad.net
Cellular: (+20) 1011.88.534 / (+20) 1444.37.175


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


Re: [Flashcoders] PHP Socket Question

2009-07-22 Thread Glen Pike
You can use a database to store data in for a chat server, but you will 
need to have some kind of server side maintenance script to weed out 
the database.


With a socket server system, you usually have to have a dedicated 
server, or at least one which lets you log into the shell and create 
scripts - most hosting does not let you run stuff like socket servers 
easily - which is why the database version may be used, because most 
hosting comes with this as standard.
To test if your system could use a socket server, grab a free script and 
try exec()'ing it from a webserver PHP script to see if you could 
theoretically start and stop your server.  I would guess most hosting 
locks this down and it may violate your TOS.


Alternatively, look at hosted systems - Electrotank used to do a socket 
server and possibly provide hosting for that, it's in Java, but you 
would not have to write all that stuff...  Also look at Moock's 
Multi-user Unity system - can't remember if that's useful or not.


There is a program called Flash Chat for $5 which is probably worth 
looking at - http://www.tufat.com/s_flash_chat_chatroom.htm - there used 
to be a version called AMFIChat, but it has been discontinued (possibly 
because the guy was violating the terms of the AMF license)


Anyway, in terms of time vs money $5 to spend looking at someone elses 
ready made system could be very cheap and you can see what server side 
stuff it does too.


Omar Fouad wrote:

hey,
My boss asked me to develop a Cards Game called Estimation (I don't know
if you heard about it). It is a Cards game similar to spades, where there
are tricks, bids, etc.
The game is going to be a Facebook application, so it is required a
multi-player option (real time).
At first I thought I would create a database and continuously let the client
send queries using AMF, to check for changes and update the display. But a
friend of mine told me this is insane. The data on the database he would
buge, and I have to take in mind, that anyone could leave the game at
anytime, so the data will remain in the database uselessly. He told me to
use sockets, and store the variables I need, such as the rooms, the player
nickname, the bids, the calls, the tricks, the scores, the rounds, the
hands, and all the crap that I would need in the server side script (PHP).
Is this true? If I will have to use sockets, should I store the data as
variables in the server side script?

I really need to figure out how to start. Thanks.

  


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


[Flashcoders] Png saving of selection of TextFormat..

2009-07-22 Thread yuva rani
Hi all,
 i have done png saving of selection of TextFormat..
i want to saving it in PHP file with transparent bg with text below the
image.
but i get text with border while saving it..
here the below code.. anything is to added in php or Flash as3 may i know..
 Any body knows this help me?



my Flash code:

function Func_CommonData() {
holder.txt1.contains(tt);
tt.text =;
tt.text = input;
var format= new TextFormat();
format.font = selectedFont;
format.color = 0x+clr_data;
format.size = switchExpression;
tt.setTextFormat(format);
tt.border = false;
tt.background = false;
tt.autoSize = TextFieldAutoSize.CENTER;
tt.condenseWhite = false;
   * holder.txt1.addChild(tt);*
tt.selectable = false;
tt.x =0;
tt.border = false;
tt.background = false;

if ((input.length 15)(switchExpression == 20)) {
tt.x =0;
tt.maxChars=12;
}
   }


bitmap part:

var _loc_2:BitmapData;
//var _loc_7:PNGEncoder;
var _loc_4:ByteArray=new ByteArray();
var _loc_5:URLRequest= new URLRequest();
var _loc_6:URLLoader= new URLLoader();

var bitmapMc:MovieClip=holder.txt1;
bitmapMc.x=holder.txt1.x;
bitmapMc.y=holder.txt1.y;
_loc_2=new BitmapData(bitmapMc.width,bitmapMc.height,true);
_loc_2.draw(bitmapMc,null,null,null,null,true);
  *  _loc_4=PNGEncoder.encode(_loc_2);*
trace(_loc_4.data :  \n +_loc_4);
_loc_5=new URLRequest()  ;
_loc_5.url=this.saveURL;
//_loc_5.contentType=multipart/form-data; boundary= +
UploadPostHelper.Func_getBoundary();
_loc_5.method=URLRequestMethod.POST;
_loc_5.data=_loc_4;
trace(**+_loc_5.data);
trace(*_loc_5.url*+_loc_5.url);
//_loc_5.requestHeaders.push(new
URLRequestHeader(Cache-Control,no-cache));
_loc_5.requestHeaders.push(new
URLRequestHeader(Content-type,application/octet-stream));
_loc_6=new URLLoader();
_loc_6.dataFormat=URLLoaderDataFormat.BINARY;
sendToURL(_loc_5);


PHP:
if(isset($GLOBALS[HTTP_RAW_POST_DATA]))
{
// get bytearray
$png = $GLOBALS[HTTP_RAW_POST_DATA];

$FName = md5(uniqid());
$filename = $FName._n.png;
$path = images/;
$image = $path.$filename;
}

@file_put_contents($image, $png);
header(Location:$image);


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


Re: [Flashcoders] PHP Socket Question

2009-07-22 Thread John McCormack

 http://www.tufat.com/s_flash_chat_chatroom.htm

Thanks for that Glen,
That looks really interesting.

John

Glen Pike wrote:
You can use a database to store data in for a chat server, but you 
will need to have some kind of server side maintenance script to 
weed out the database.


With a socket server system, you usually have to have a dedicated 
server, or at least one which lets you log into the shell and create 
scripts - most hosting does not let you run stuff like socket servers 
easily - which is why the database version may be used, because most 
hosting comes with this as standard.
To test if your system could use a socket server, grab a free script 
and try exec()'ing it from a webserver PHP script to see if you could 
theoretically start and stop your server.  I would guess most hosting 
locks this down and it may violate your TOS.


Alternatively, look at hosted systems - Electrotank used to do a 
socket server and possibly provide hosting for that, it's in Java, but 
you would not have to write all that stuff...  Also look at Moock's 
Multi-user Unity system - can't remember if that's useful or not.


There is a program called Flash Chat for $5 which is probably worth 
looking at - http://www.tufat.com/s_flash_chat_chatroom.htm - there 
used to be a version called AMFIChat, but it has been discontinued 
(possibly because the guy was violating the terms of the AMF license)


Anyway, in terms of time vs money $5 to spend looking at someone 
elses ready made system could be very cheap and you can see what 
server side stuff it does too.


Omar Fouad wrote:

hey,
My boss asked me to develop a Cards Game called Estimation (I don't 
know
if you heard about it). It is a Cards game similar to spades, where 
there

are tricks, bids, etc.
The game is going to be a Facebook application, so it is required a
multi-player option (real time).
At first I thought I would create a database and continuously let the 
client
send queries using AMF, to check for changes and update the display. 
But a

friend of mine told me this is insane. The data on the database he would
buge, and I have to take in mind, that anyone could leave the game at
anytime, so the data will remain in the database uselessly. He told 
me to
use sockets, and store the variables I need, such as the rooms, the 
player

nickname, the bids, the calls, the tricks, the scores, the rounds, the
hands, and all the crap that I would need in the server side script 
(PHP).

Is this true? If I will have to use sockets, should I store the data as
variables in the server side script?

I really need to figure out how to start. Thanks.

  


___
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] Png saving of selection of TextFormat..

2009-07-22 Thread Glen Pike
Not sure about the border bit, but your PHP code leaves you wide open to 
someone uploading some very nasty code that is not necessarily a png 
image.  You should at least getimagesize or Imagick to check if it's a 
valid image before saving it to a folder accessible from the web.


yuva rani wrote:

Hi all,
 i have done png saving of selection of TextFormat..
i want to saving it in PHP file with transparent bg with text below the
image.
but i get text with border while saving it..
here the below code.. anything is to added in php or Flash as3 may i know..
 Any body knows this help me?



my Flash code:

function Func_CommonData() {
holder.txt1.contains(tt);
tt.text =;
tt.text = input;
var format= new TextFormat();
format.font = selectedFont;
format.color = 0x+clr_data;
format.size = switchExpression;
tt.setTextFormat(format);
tt.border = false;
tt.background = false;
tt.autoSize = TextFieldAutoSize.CENTER;
tt.condenseWhite = false;
   * holder.txt1.addChild(tt);*
tt.selectable = false;
tt.x =0;
tt.border = false;
tt.background = false;

if ((input.length 15)(switchExpression == 20)) {
tt.x =0;
tt.maxChars=12;
}
   }


bitmap part:

var _loc_2:BitmapData;
//var _loc_7:PNGEncoder;
var _loc_4:ByteArray=new ByteArray();
var _loc_5:URLRequest= new URLRequest();
var _loc_6:URLLoader= new URLLoader();

var bitmapMc:MovieClip=holder.txt1;
bitmapMc.x=holder.txt1.x;
bitmapMc.y=holder.txt1.y;
_loc_2=new BitmapData(bitmapMc.width,bitmapMc.height,true);
_loc_2.draw(bitmapMc,null,null,null,null,true);
  *  _loc_4=PNGEncoder.encode(_loc_2);*
trace(_loc_4.data :  \n +_loc_4);
_loc_5=new URLRequest()  ;
_loc_5.url=this.saveURL;
//_loc_5.contentType=multipart/form-data; boundary= +
UploadPostHelper.Func_getBoundary();
_loc_5.method=URLRequestMethod.POST;
_loc_5.data=_loc_4;
trace(**+_loc_5.data);
trace(*_loc_5.url*+_loc_5.url);
//_loc_5.requestHeaders.push(new
URLRequestHeader(Cache-Control,no-cache));
_loc_5.requestHeaders.push(new
URLRequestHeader(Content-type,application/octet-stream));
_loc_6=new URLLoader();
_loc_6.dataFormat=URLLoaderDataFormat.BINARY;
sendToURL(_loc_5);


PHP:
if(isset($GLOBALS[HTTP_RAW_POST_DATA]))
{
// get bytearray
$png = $GLOBALS[HTTP_RAW_POST_DATA];

$FName = md5(uniqid());
$filename = $FName._n.png;
$path = images/;
$image = $path.$filename;
}

@file_put_contents($image, $png);
header(Location:$image);


regards,
yuva
___
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] Filtering xml with E4X

2009-07-22 Thread Joel Stransky
The predicate filter should also work.

myXMLList:XMLList = projectsXML..tags.(tag == Website);  //return an
XMLList object containing all tag nodes who's value is Website

On Thu, Jul 16, 2009 at 9:11 AM, Mark Burvill li...@eyegas.com wrote:

 Awesome - that's what I'm after. I didn't know about contains.

 Thanks


 On 16 Jul 2009, at 13:56, Kenneth Kawamoto wrote:

  You may want to try:

 projectsXML.project.(tags.tag.contains(Website))

 Kenneth Kawamoto
 http://www.materiaprima.co.uk/

 Mark Burvill wrote:

 Hello flashcoders,
 I'm trying to work out how to filter the below XML (loaded into a var
 called projectsXML) by the contents of the tag nodes, but can't quite
 get it working.
 So for instance, how would I use an E4X expression to return an XMLList
 that contained only those projects which have a tag of Website?
 Here's the xml:
 projects
   project
   titleMy project/title
   tags
   tagWebsite/tag
   /tags
   /project
   project
   titleAnother project/title
   tags
   tagGame/tag
   /tags
   /project
   project
   titleYet another one/title
   tags
   tagWebsite/tag
   tagGame/tag
   tagApplication/tag
   /tags
   /project
   project
   titleAnd another/title
   tags
   tagGame/tag
   tagWebsite/tag
   /tags
   /project
 /projects
 Thanks,
 Mark.

 ___
 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




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Just a stupid question (hope you can help me)

2009-07-22 Thread Joel Stransky
You should be able to set this in the Gaia panel that's added to the Flash
IDE when you install the framework.

On Mon, Jul 20, 2009 at 11:09 AM, Mario Gonzalez ma...@wddg.com wrote:

 I'm not familiar with the Gaia framework, so I'm not sure what some of
 those function calls (alignSite()) or properties are (__WIDTH).
 However all you need to do, is call this on onResize

 --
 x = int(stage.stageWidth/2 - width/2);
 y = int(stage.stageHeight/2 - height/2);
 -
 Another thing to note, is that width and height will change depending on
 whats on the stage.
 If you know that going in you will have stuff that might break the frame
 (even if masked), you want to use your preset width and height in which case
 you just call:
 --
 x = int(stage.stageWidth/ 2 - 1024/2);
 y = int(stage.stageHeight/ 2 - 768/2);
 ---

 You want to make sure you place the center of the stage to the center of
 your object (half it's width).

 Hope it helps,
 http://onedayitwillmake.com


 PWMedia | Paul Wolthuis wrote:

 Hi there,

 I've got a question.

 I'm sort of a scriptdummy and having a problem to make a gaia sit  fully
 scalable.
 To make it clear, i want the full site to scale  up or down to the  size
 of the browserwindow and center it horizontal and vertical.

 Hope anyone can help me.
 Thanks so far!

 Paul

 --

 package
 {
import com.gaiaframework.core.GaiaMain;

import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;

public class Main extends GaiaMain
{
public function Main()
{
super();
siteXML = xml/site.xml;
}
override protected function
 onAddedToStage(event:Event):void
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
alignSite(1024, 768);
super.onAddedToStage(event);
}
override protected function onResize(event:Event):void
{
view.x = Math.round((stage.stageWidth - __WIDTH) /
 2);
view.y = Math.round((stage.stageHeight - __HEIGHT)
 / 2);
}
}
 }
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 __ Information from ESET NOD32 Antivirus, version of virus
 signature database 4261 (20090720) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com



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




-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Dancing characters...

2009-07-22 Thread Sander Schuurman

Hi list...

I'm trying to make some kind of Dock...

http://www.sentoplene.com/dock

But sometimes when I stop with the mouse, some characters keep on  
moving slightly... How can I get rid of that?


I'm simply doing on Event .ENTER_FRAME: scaleIcons and then  
positionIcons.
I'v tried to trigger the 2 functions only on MouseMove, but the  
responsiveness isn't accurate when you suddenly stop your mouse...


So anyone any idea with this?

thnx!

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


RE: [Flashcoders] Dancing characters...

2009-07-22 Thread Cor
That's because of your ENTER_FRAME I guess.

Use MOUSE_OVER and MOUSE_OUT instead

Look here and mouse over the bottom menu:
http://www.badmintonclubnetwerk.nl/_Cor/TYG/


Regards

Cor van Dooren
The Netherlands

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Sander
Schuurman
Sent: woensdag 22 juli 2009 17:31
To: Flash Coders List
Subject: [Flashcoders] Dancing characters...

Hi list...

I'm trying to make some kind of Dock...

http://www.sentoplene.com/dock

But sometimes when I stop with the mouse, some characters keep on  
moving slightly... How can I get rid of that?

I'm simply doing on Event .ENTER_FRAME: scaleIcons and then  
positionIcons.
I'v tried to trigger the 2 functions only on MouseMove, but the  
responsiveness isn't accurate when you suddenly stop your mouse...

So anyone any idea with this?

thnx!

Sander Schuurman
sentoplene.com
___
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] Dancing characters...

2009-07-22 Thread Ruy Adorno

Hello Sander,

Nice to see you around here, I saw in twitter you're starting your own 
dock effect this morning.
It's hard to know the reason for this strange behavior of the elements 
without see the code, but I have a guess that could be some problems 
with float numbers, I already have similar problems caused by this.
You can try to round the elements positions at each enterFrame call, try 
using int() and Math.floor().


Best,

Ruy Adorno
http://www.ruyadorno.com


Sander Schuurman wrote:

Hi list...

I'm trying to make some kind of Dock...

http://www.sentoplene.com/dock

But sometimes when I stop with the mouse, some characters keep on 
moving slightly... How can I get rid of that?


I'm simply doing on Event .ENTER_FRAME: scaleIcons and then 
positionIcons.
I'v tried to trigger the 2 functions only on MouseMove, but the 
responsiveness isn't accurate when you suddenly stop your mouse...


So anyone any idea with this?

thnx!

Sander Schuurman
sentoplene.com
___
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] Dancing characters...

2009-07-22 Thread Eric E. Dolecki
try rounded values?

On Wed, Jul 22, 2009 at 11:31 AM, Sander Schuurman b...@chello.nl wrote:

 Hi list...

 I'm trying to make some kind of Dock...

 http://www.sentoplene.com/dock

 But sometimes when I stop with the mouse, some characters keep on moving
 slightly... How can I get rid of that?

 I'm simply doing on Event .ENTER_FRAME: scaleIcons and then positionIcons.
 I'v tried to trigger the 2 functions only on MouseMove, but the
 responsiveness isn't accurate when you suddenly stop your mouse...

 So anyone any idea with this?

 thnx!

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




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Dancing characters...

2009-07-22 Thread Ian Thomas
Also - have you got those text fields set to anti-alias for
animation? If not, you should - anti-alias for readability can
cause odd effects for moving text.

HTH,
   Ian

On Wed, Jul 22, 2009 at 4:44 PM, Ruy Adornor...@lesite.ca wrote:
 Hello Sander,

 Nice to see you around here, I saw in twitter you're starting your own dock
 effect this morning.
 It's hard to know the reason for this strange behavior of the elements
 without see the code, but I have a guess that could be some problems with
 float numbers, I already have similar problems caused by this.
 You can try to round the elements positions at each enterFrame call, try
 using int() and Math.floor().

 Best,

 Ruy Adorno
 http://www.ruyadorno.com


 Sander Schuurman wrote:

 Hi list...

 I'm trying to make some kind of Dock...

 http://www.sentoplene.com/dock

 But sometimes when I stop with the mouse, some characters keep on moving
 slightly... How can I get rid of that?

 I'm simply doing on Event .ENTER_FRAME: scaleIcons and then positionIcons.
 I'v tried to trigger the 2 functions only on MouseMove, but the
 responsiveness isn't accurate when you suddenly stop your mouse...

 So anyone any idea with this?

 thnx!

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


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

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


Re: [Flashcoders] Just a stupid question (hope you can help me)

2009-07-22 Thread PWMedia | Paul Wolthuis

Hi Guys,

Thanks for helping me out!!!

I know about the Gaia panel option to set 100% width and 100% height  
in combination with the center/center option.

This option scales the background (index).

The thing i'm trying to do is to make the diferent pages i've designed  
scale up or down as well.


There is an gaia-examplewith 100% width, 100% height and center/center  
posted under:

www.pwmedia.nl/test/index.html

what i want is the gaiapages behave like:
www.pwmedia.nl/test/index2.html
(this is just a flas file)

Hope jou can help me!
Thanks so far.



Op 22 jul 2009, om 16:28 heeft Joel Stransky het volgende geschreven:



You should be able to set this in the Gaia panel that's added to the  
Flash

IDE when you install the framework.

On Mon, Jul 20, 2009 at 11:09 AM, Mario Gonzalez ma...@wddg.com  
wrote:


I'm not familiar with the Gaia framework, so I'm not sure what some  
of

those function calls (alignSite()) or properties are (__WIDTH).
However all you need to do, is call this on onResize

--
x = int(stage.stageWidth/2 - width/2);
y = int(stage.stageHeight/2 - height/2);
-
Another thing to note, is that width and height will change  
depending on

whats on the stage.
If you know that going in you will have stuff that might break the  
frame
(even if masked), you want to use your preset width and height in  
which case

you just call:
--
x = int(stage.stageWidth/ 2 - 1024/2);
y = int(stage.stageHeight/ 2 - 768/2);
---

You want to make sure you place the center of the stage to the  
center of

your object (half it's width).

Hope it helps,
http://onedayitwillmake.com


PWMedia | Paul Wolthuis wrote:


Hi there,

I've got a question.

I'm sort of a scriptdummy and having a problem to make a gaia sit   
fully

scalable.
To make it clear, i want the full site to scale  up or down to  
the  size

of the browserwindow and center it horizontal and vertical.

Hope anyone can help me.
Thanks so far!

Paul

--

package
{
  import com.gaiaframework.core.GaiaMain;

  import flash.display.StageScaleMode;
  import flash.display.StageAlign;
  import flash.events.Event;

  public class Main extends GaiaMain
  {
  public function Main()
  {
  super();
  siteXML = xml/site.xml;
  }
  override protected function
onAddedToStage(event:Event):void
  {
  stage.align = StageAlign.TOP_LEFT;
  stage.scaleMode = StageScaleMode.NO_SCALE;
  alignSite(1024, 768);
  super.onAddedToStage(event);
  }
  override protected function onResize(event:Event):void
  {
  view.x = Math.round((stage.stageWidth -  
__WIDTH) /

2);
  view.y = Math.round((stage.stageHeight -  
__HEIGHT)

/ 2);
  }
  }
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





__ Information from ESET NOD32 Antivirus, version of virus
signature database 4261 (20090720) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



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





--
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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


[Flashcoders] Enterprise Architect + AS3

2009-07-22 Thread artur

is it possible to have EA create a UML from AS3 classes built using PureMVC?

if so,

can it also update/sync the UML when the class is manually changed?

also how difficult is it to setup EA to run on an MAC?

thanks

artur

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


Re: [Flashcoders] Enterprise Architect + AS3

2009-07-22 Thread Paul Andrews

artur wrote:
is it possible to have EA create a UML from AS3 classes built using 
PureMVC?


if so,

can it also update/sync the UML when the class is manually changed?

also how difficult is it to setup EA to run on an MAC?

There is a 30 day trial..


thanks

artur

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



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


[Flashcoders] test123

2009-07-22 Thread artur


--

*artur :.*

- *www.artur.com*
- *ar...@artur.com*
- *ph:646.797.3320*

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


[Flashcoders] Enterprise Architect + AS3

2009-07-22 Thread artur

is it possible to have EA create a UML from AS3 classes built using PureMVC?

if so,

can it also update/sync the UML when the class is manually changed?

also how difficult is it to setup EA to run on an MAC?

thanks

artur


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


Re: [Flashcoders] Enterprise Architect + AS3

2009-07-22 Thread artur
can anyone point me to a good tutorial on how to setup EA for AS3 code 
generation?

i found this old tutorial for AS2...but im sure its outdated.
http://www.5etdemi.com/as2codegen/convertToAS2project.html

thanks

*artur :.*

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


[Flashcoders] Need some help with my maths...

2009-07-22 Thread Glen Pike

Hi,

   I have a problem where I have implemented a 3D cube and an intro 
sequence which can be seen here:


   http://glenpike.co.uk/fitkin/_index.php

My problem is that I had to calculate the initial positions of the 
zoomed in cube by using sliders to tweak the value then hardcoding them...


   I (and the client) would like the Flash to fill the screen 100%, so 
that the cube is centred, but this means that I need to calculate the 
start position so the G of the logo fills the screen and calculate the 
zoomed in position of the so that the cube lines up - these points are 
relative to the browser top-left rather than the world 0,0 which needs 
to be taken into account...


   I think I can do this with 3D projection calcs, but can't work out 
how to do it or find some nice and simple explanations online. So if 
anyone has any tips / pointers, I would be greatful...


   The figures are so:

   SWF size 800 x 600, so centre is 400 x 300.

   The Cube is 600 x 600 x 600 with the logo @ -295, 295 (0,0,0 is the 
cube centre)
  
   At zoomed out it is at 0, 0, 3000, scaled to 1.0


   At the beginning of the intro, it is @ 1025, -1023, 48, scaled to 3.89

   Zoomed in it is @ 827, 794, 200, scaled to 3

   So what I would like to do is work out x, y  z for the intro and 
zoomed in position for an arbitrary screen size with the world 0, 0 
centred in the middle of the screen...


   Thanks in advance for any help.

   Glen
--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

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