Re: [Flashcoders] Re: Flushing Socket data when TCP-connection suspends and then resumes

2011-05-26 Thread Alexander Farber
I'm using a poll() in my server (in Perl, but it could be C,
and it could be select() instead of poll() - doesn't matter).

When poll() reported there is incoming data by POLLIN event,
I was calling my subroutine to read incoming data.

But I don't want to read 2 bytes and then later (on next poll() result)
the rest data eventhough I'm using writeUTF() at the
Flash client side - because it is not effective this way.

So I'm always calling read(..., ..., 8192) to try to read more bytes at once.

And my error was, that I was trying to extract just
_one_ UTF string with 2 bytes prefix from the buffer.

But in fact I should do it in a loop, because there could be several
such strings+prefixes in the 8192 bytes long incoming buffer.

Regards
Alex

On Mon, May 23, 2011 at 10:33 AM, allandt bik-elliott
(thefieldcomic.com) alla...@gmail.com wrote:
 What was the issue?
 On May 19, 2011 2:07 PM, Alexander Farber alexander.far...@gmail.com
 wrote:
 Nevermind, found 1 issue in my server...
 _
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] rotate along a path using sine curve

2011-05-26 Thread allandt bik-elliott (thefieldcomic.com)
hey folks

i'm trying to get some objects to move along a sine curve on the z axis but
i'm having a bit of trouble with the rotationY - i'd like the objects to
align along the path so they're always facing 90 degress to the direction
they're travelling but they seem to want to keep rotating in circles

(note file is 800 x 600)

here's my code:
package
{
//imports
 public class CarouselTest extends Sprite
{
public static const SPACING : int = 20;
public static const SPEED : Number = .05;
public static const XSPEED : Number = 800 / 360 * 2;
public static const RADIUS : int = 400;
 private var _items:Array;
private var _container:Sprite;
 public function CarouselTest()
{
_items = new Array();
 _container = new Sprite();
_container.x = 400;
_container.y = 300;
addChild(_container);
 var item:CarouselItem = new CarouselItem();
for (var i:int = 0; i  200; i++)
{
item = new CarouselItem();
item.angle = i * SPACING;
item.x = i * SPACING * 5 - 1000; // move into desired position
item.speed = SPEED;
_container.addChild(item);
_items.push(item);
}
 addEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
 private function handleEnterFrame(e:Event):void
{
var item:CarouselItem;
for (var i:int = 0; i  _items.length; i++)
{
item = _items[i] as CarouselItem;
item.angle += SPEED;
item.z = Math.sin(item.angle) * RADIUS;
item.rotationY = Trig.radiansToDegrees(item.angle)  * -1; // this is the
area i'm stuck on
item.x += XSPEED;
}
 SimpleZSorter.sortClips(_container); // thankyou mr papervision and lee
brimelow
}
 }

}

hope you can help
A
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] trying to get data from list component

2011-05-26 Thread DONALD TALCOTT
I have a list component (multiple selection) on the stage. I am trying to send 
the selections from the list to sql database via php.
I'm using the script below to convert the data selected from the list to a 
string. The trace works as designed.
What do I send in my variables to php script? 
topskillsfield.selectedIndices is not working. topskillsfield is my list 
item.
Any help would be greatly appreciated.

submitTwoBtn.addEventListener(MouseEvent.CLICK, submitHandler);
 
function submitHandler(e:MouseEvent) {
var myArr:Array = topskillsfield.selectedIndices;
 
var selectedTopSkills:String = ;
 
for(var i:int = 0; i  myArr.length; i++) {
var j:int = myArr[i];
if(selectedTopSkills == ) {
selectedTopSkills = topskillsfield.getItemAt(j).data;
} else {
selectedTopSkills += ,  + 
topskillsfield.getItemAt(j).data;
}
}
 
trace(selectedTopSkills:  + selectedTopSkills);
}
DON TALCOTT
316 Greenwood Avenue
Decatur, Georgia 30030

404.538.1642
dtalc...@mindspring.com





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


Re: [Flashcoders] trying to get data from list component

2011-05-26 Thread Karl DeSaulniers

.selectedIndex  ??


On May 26, 2011, at 2:36 PM, DONALD TALCOTT wrote:


.selectedIndices


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


RE: [Flashcoders] trying to get data from list component

2011-05-26 Thread Creighton, Gerry
Check out this page to get a handle...
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLVariables.html



-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of DONALD TALCOTT
Sent: Thursday, May 26, 2011 3:37 PM
To: Flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] trying to get data from list component

I have a list component (multiple selection) on the stage. I am trying to send 
the selections from the list to sql database via php.
I'm using the script below to convert the data selected from the list to a 
string. The trace works as designed.
What do I send in my variables to php script? 
topskillsfield.selectedIndices is not working. topskillsfield is my list 
item.
Any help would be greatly appreciated.

submitTwoBtn.addEventListener(MouseEvent.CLICK, submitHandler);
 
function submitHandler(e:MouseEvent) {
var myArr:Array = topskillsfield.selectedIndices;
 
var selectedTopSkills:String = ;
 
for(var i:int = 0; i  myArr.length; i++) {
var j:int = myArr[i];
if(selectedTopSkills == ) {
selectedTopSkills = topskillsfield.getItemAt(j).data;
} else {
selectedTopSkills += ,  + 
topskillsfield.getItemAt(j).data;
}
}
 
trace(selectedTopSkills:  + selectedTopSkills);
}
DON TALCOTT
316 Greenwood Avenue
Decatur, Georgia 30030

404.538.1642
dtalc...@mindspring.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] trying to get data from list component

2011-05-26 Thread DONALD TALCOTT
function submitHandler(e:MouseEvent) {
var myArr:Array = topskillsfield.selectedIndices;
 
var selectedTopSkills:String = ;
 
for(var i:int = 0; i  myArr.length; i++) {
var j:int = myArr[i];
if(selectedTopSkills == ) {
selectedTopSkills = topskillsfield.getItemAt(j).data;
} else {
selectedTopSkills += ,  + 
topskillsfield.getItemAt(j).data;
}
}
 
trace(selectedTopSkills:  + selectedTopSkills);
}
my trace ouputs the following: selectedTopSkills: Written Communication, 
Networking, Public Speaking, Negotiation, Strategic Planning

When I use the following in my variables, the number of selections (5) is 
posted to db.

I need to post Written Communication, Networking, Public Speaking, 
Negotiation, Strategic Planning to the db.

var variables:URLVariables = new URLVariables();
variables.firstname = fnamefield.text;
variables.lastname = lnamefield.text;
variables.title = titlefield.text;
variables.dept = deptfield.value;
variables.email = emailfield.text;
variables.nickname = mc_one.nicknamefield.text;
variables.birthday = mc_one.birthdayfield.text;
variables.anniversary = mc_one.anniversaryfield.text;
variables.topskills = mc_two.topskillsfield.selectedIndices;
variables.rightlefthanded = mc_three.radioGroup1.selection.value;
variables.hometown = mc_four.hometownfield.text;
variables.college = mc_four.collegefield.text;
variables.achievement1 = mc_five.achievement1field.text;
variables.achievement2 = mc_five.achievement2field.text;
variables.photo = mc_six.photo.fileDisplay_txt.text;
On May 26, 2011, at 3:41 PM, Karl DeSaulniers wrote:

 .selectedIndex  ??
 
 
 On May 26, 2011, at 2:36 PM, DONALD TALCOTT wrote:
 
 .selectedIndices
 
 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

DON TALCOTT
316 Greenwood Avenue
Decatur, Georgia 30030

404.538.1642
dtalc...@mindspring.com





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


[Flashcoders] Touch Events

2011-05-26 Thread Paul Andrews

I've been using Flash CS5.5 targeting the IOS platform.

I have been writing a small application that relies on things being 
dragged around - can't really say much more right now.


I need to know when dragging starts, so on the thing that's being 
dragged I add a listener for TouchEvent.TOUCH_BEGIN.


I need to know when it's being moved, so the widget also has a listener 
for TouchEvent.TOUCH_MOVE.


And finally, I need to know when dragging stops, so the widget listens 
for TouchEvent.TOUCH_END.


Now mostly, everything goes OK, I get:

TOUCH_BEGIN, followed by one or more TOUCH_MOVE, and finally a 
TOUCH_END. Happiness.


I have noticed that sometimes if I drag too fast and/or gently do a 
swipe motion lifting my finger gently, the TOUCH_END doesn't seem to 
happen, so the app doesn't know that the user has stopped dragging. For 
the app, this is a problem because the user is allowed to position the 
widget roughly and on TOUCH_END it should snap into place.


Anyone else seen this?

I can imagine a workaround using a timer to catch missing TOUCH_END 
events, but it's a bit of a kludge.


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


Re: [Flashcoders] trying to get data from list component

2011-05-26 Thread Karl DeSaulniers

Try this...

On May 26, 2011, at 3:27 PM, DONALD TALCOTT wrote:


function submitHandler(e:MouseEvent) {
var myArr:Array = topskillsfield.selectedIndices;

var selectedTopSkills:String = ;

for(var i:int = 0; i  myArr.length; i++) {
var j:int = myArr[i];
if(selectedTopSkills == ) {
selectedTopSkills = topskillsfield.getItemAt(j).data;
} else {
	selectedTopSkills += ,  + topskillsfield.getItemAt 
(j).data;

}
}


return selectedTopSkills;
//trace(selectedTopSkills:  + selectedTopSkills);

}
my trace ouputs the following: selectedTopSkills: Written  
Communication, Networking, Public Speaking, Negotiation, Strategic  
Planning


When I use the following in my variables, the number of selections  
(5) is posted to db.


I need to post Written Communication, Networking, Public Speaking,  
Negotiation, Strategic Planning to the db.


var variables:URLVariables = new URLVariables();
variables.firstname = fnamefield.text;
variables.lastname = lnamefield.text;
variables.title = titlefield.text;
variables.dept = deptfield.value;
variables.email = emailfield.text;
variables.nickname = mc_one.nicknamefield.text;
variables.birthday = mc_one.birthdayfield.text;
variables.anniversary = mc_one.anniversaryfield.text;

//variables.topskills = mc_two.topskillsfield.selectedIndices;
variables.topskills = selectedTopSkills; // Must be set after above  
function is called.

variables.rightlefthanded = mc_three.radioGroup1.selection.value;
variables.hometown = mc_four.hometownfield.text;
variables.college = mc_four.collegefield.text;
variables.achievement1 = mc_five.achievement1field.text;
variables.achievement2 = mc_five.achievement2field.text;
variables.photo = mc_six.photo.fileDisplay_txt.text;


HTH,
Best,


Karl DeSaulniers
Design Drumm
http://designdrumm.com

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


RE: [Flashcoders] rotate along a path using sine curve

2011-05-26 Thread allandt bik-elliott (thefieldcomic.com)
Hey Cor

What else would you need?
On May 26, 2011 9:20 PM, Cor c...@chello.nl wrote:
 Allandt,

 Can you send me the necessary source so I can look into it?

 Regards,
 Cor van Dooren


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt
 bik-elliott (thefieldcomic.com)
 Sent: donderdag 26 mei 2011 18:52
 To: Flash Coders List
 Subject: [Flashcoders] rotate along a path using sine curve

 hey folks

 i'm trying to get some objects to move along a sine curve on the z axis
but
 i'm having a bit of trouble with the rotationY - i'd like the objects to
 align along the path so they're always facing 90 degress to the direction
 they're travelling but they seem to want to keep rotating in circles

 (note file is 800 x 600)

 here's my code:
 package
 {
 //imports
 public class CarouselTest extends Sprite { public static const SPACING :
 int = 20; public static const SPEED : Number = .05; public static const
 XSPEED : Number = 800 / 360 * 2; public static const RADIUS : int = 400;
 private var _items:Array; private var _container:Sprite; public function
 CarouselTest() { _items = new Array(); _container = new Sprite();
 _container.x = 400; _container.y = 300; addChild(_container); var
 item:CarouselItem = new CarouselItem(); for (var i:int = 0; i  200; i++)
{
 item = new CarouselItem(); item.angle = i * SPACING; item.x = i * SPACING
*
 5 - 1000; // move into desired position item.speed = SPEED;
 _container.addChild(item); _items.push(item); }
 addEventListener(Event.ENTER_FRAME, handleEnterFrame); } private function
 handleEnterFrame(e:Event):void { var item:CarouselItem; for (var i:int =
0;
 i  _items.length; i++) { item = _items[i] as CarouselItem; item.angle +=
 SPEED; item.z = Math.sin(item.angle) * RADIUS; item.rotationY =
 Trig.radiansToDegrees(item.angle) * -1; // this is the area i'm stuck on
 item.x += XSPEED; } SimpleZSorter.sortClips(_container); // thankyou mr
 papervision and lee brimelow } }

 }

 hope you can help
 A
 ___
 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