[Flashcoders] doing components or buttons in as project

2007-06-16 Thread Gustavo Duenas
hi how could I do a button for an as project in flex, that mean I  
have to do this buttons in flash cs3 an then saves it as .swf an then  
how can I import into the

as project?

I don't know If can explain myself clearly but outlines this most i'd  
like to do.



regards

Gustavo

___
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] help with a thread in cs3

2007-06-16 Thread David Ngo
You need to add an event listener for when the image load is complete.

package {
import flash.display*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;

public class WholeImage extends Sprite
{
private var backLoader:Loader;

public function WholeImage()
{
backLoader = new Loader();
backLoader.addEventListener(Event.COMPLETE,
onImageComplete);
backLoader.load(new
URLRequest("http://leftandrightsolutions.com/ 
backy1.jpg"));
}

private function onImageComplete(event:Event):void
{
backLoader.x = -200;
backLoader.y = 0;
addChild(backLoader);
}
}
}




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gustavo
Duenas
Sent: Saturday, June 16, 2007 7:15 PM
To: Flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] help with a thread in cs3

hi coders I have this code and I'd like to have the loader to some  
new size but thing are not going as expected, the code is:


package {
import flash.display.Sprite;
import flash.display.*;
import flash.events.*;
import flash.accessibility.*;
import com.adobe.viewsource.ViewSource;
import flash.net.*;
 import flash.geom.*;
 import flash.text.*;
 import flash.net.URLRequest;
 import flash.net.*;



public class wholeImage1 extends Sprite
{
public function wholeImage1()
{

//inserting image as background;
var backLoader:Loader = new Loader();
backLoader.load(new
URLRequest("http://leftandrightsolutions.com/ 
backy1.jpg"));
backLoader.x=-200;
backLoader.y=0;
addChild(backLoader);



}
}
}


I want to do something like this backloader.width= 1440;
  backloader.height=600;
and when I finally used it doesn't work, you know how could do I?


Regards


Gustavo Duenas


___
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] help with a thread in cs3

2007-06-16 Thread Gustavo Duenas
hi coders I have this code and I'd like to have the loader to some  
new size but thing are not going as expected, the code is:



package {
import flash.display.Sprite;
import flash.display.*;
import flash.events.*;
import flash.accessibility.*;
import com.adobe.viewsource.ViewSource;
import flash.net.*;
import flash.geom.*;
import flash.text.*;
import flash.net.URLRequest;
import flash.net.*;



public class wholeImage1 extends Sprite
{
public function wholeImage1()
{

//inserting image as background;
var backLoader:Loader = new Loader();
			backLoader.load(new URLRequest("http://leftandrightsolutions.com/ 
backy1.jpg"));

backLoader.x=-200;
backLoader.y=0;
addChild(backLoader);



}
}
}


I want to do something like this backloader.width= 1440;
 backloader.height=600;
and when I finally used it doesn't work, you know how could do I?


Regards


Gustavo Duenas


___
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] Repost: Movie Explorer question

2007-06-16 Thread Muzak
nope

- Original Message - 
From: "Jonathan Berry" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, June 16, 2007 8:59 PM
Subject: Re: [Flashcoders] Repost: Movie Explorer question


> Thanks Muzak. Has this changed at all in CS3?
>
> On 6/16/07, Muzak <[EMAIL PROTECTED]> wrote:
>>
>> Only stage assets.
>> So just drop everything in the Lib in a keyframe on stage.
>>


___
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] Estimating the time required for a project

2007-06-16 Thread Hans Wichman

Hi,

well one advice is to start recording your current measures and check
afterwards how close you were.
Record things you forget that made your estimates go wrong, records the
factor realhours vs estimate.
Assume that when you think you know everything, you only know about 40% of
whats going to happen.
Adjust your estimate as you go along. Put your estimate on paper, and
include your assumptions.
If the assumptions change, check if you estimates need to be adjusted too.

Read up on software management lifecycle or books that describe software
processes such as code complete or mythical manmonth, to understand WHY
estimating a software project is hard, and how you can make your manager
understand.

It's pretty easy to become better at estimating theoretically, say you have
a project and its estimate is 10 hours. Now it turns out to be 40 hours.
Next time you estimate 20 hours, and you go 'hey but wait, i was wrong by
400% last time', so you say 80. The hard part of doing it this way is not
having rock solid arguments to present to your boss.

Other things that come with understanding the software process is the
difference between the time it takes to hack something together, or create a
software product, or a software system of combined working products. A proof
of concept for a memory game might take 45 minutes, but a full flegded off
the shelf sellable memory game might take a month. It's still just a memory
game.

etc etc

To conclude my best advice is probably to:
* start measuring, and try to understand why your estimate was wrong (or
right)
* read up on software development material

greetz
JC





On 6/16/07, James Deakin <[EMAIL PROTECTED]> wrote:


I'm looking to improve the accuracy of the estimations of time required
which I give to my project managers. Does anyone have any good advice?

Please note that I am far from a newbie as I have been programming
actionScript ever since it first came out (with that nasty slash syntax).
This is one area of the job which we never seem to talk about but its is
one
of the most important.

James Deakin
___
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] webcam video capture

2007-06-16 Thread [p e r c e p t i c o n]

thanks Bob and Jim!
p

On 6/15/07, Bob Wohl <[EMAIL PROTECTED]> wrote:


>anywhere outside that camera object

(other than bitmap class like jim just posted)

On 6/15/07, Bob Wohl <[EMAIL PROTECTED]> wrote:
>
> yes and no. You can do a camera.get but that will basicaly create a
> connection to your camera, no one else can see it just you. It is not
only a
> few frames, it is live.  it's also not accessible (images that is) to
use
> anywhere outside that camera object. 'Capturing' it and saving to a
source
> can only be done through FMS (server side FLV which I believe is not
> accessible outside of the server it's self).
>
>
> B.
>
>
> On 6/15/07, [p e r c e p t i c o n] <[EMAIL PROTECTED]> wrote:
> >
> > Hi all,
> > is there a way to capture web cam video straight into flash...not a
> > single
> > frame, but a few seconds worth?
> >
> > thanks
> > p
> > ___
> > 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] Repost: Movie Explorer question

2007-06-16 Thread Jonathan Berry

Thanks Muzak. Has this changed at all in CS3?

On 6/16/07, Muzak <[EMAIL PROTECTED]> wrote:


Only stage assets.
So just drop everything in the Lib in a keyframe on stage.

- Original Message -
From: "Jonathan Berry" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Saturday, June 16, 2007 2:51 AM
Subject: [Flashcoders] Repost: Movie Explorer question


> Hey, did anyone have any ideas about this? Sorry for the bother. Thanks
> again.
>
> -- Forwarded message --
> From: Jonathan Berry <[EMAIL PROTECTED]>
> Date: Jun 13, 2007 3:20 PM
> Subject: Movie Explorer question
> To: Flashcoders mailing list 
>
> Hello all!
> I have a general question about the Movie Explorer. I like it quite a
bit
> because we receive FLAs from our partners or third parties that have
code
> hidden in them at different locations [that nasty object(i.e . mc or
> button)-based coding that I tend to shy away from especially]. However,
when
> an mc or button is attached from the library it appears that code within
the
> objects is not displayed in the movie explorer. Is there a way to set
the
> explorer to display this code when present? I have checked on and off
all
> the options in the interface and have found no way to do this. We are
still
> using Flash 8, so I don't know if they added this support in the newest
> interface. Thanks so much.
>
> --
> Jonathan Berry, M.A.


___
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





--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com

---

This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged.
This information is confidential information and is intended only for
the use of the individual or entity named above. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.

---
___
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] Estimating the time required for a project

2007-06-16 Thread James Deakin

I'm looking to improve the accuracy of the estimations of time required
which I give to my project managers. Does anyone have any good advice?

Please note that I am far from a newbie as I have been programming
actionScript ever since it first came out (with that nasty slash syntax).
This is one area of the job which we never seem to talk about but its is one
of the most important.

James Deakin
___
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] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org
Please I really need help on this on, I am cracking my head over it. 
Bresenham algo is also not the way to go, because it is for circle's and 
to complex!

I can only get one ring, arggg

If I go one ring further then it results in many double values, 
calculate allready when doing the first ring.


Here is the code..

var row = 0;
var c:Number = 3;
var ring:Number = 1;
//take start pos [2,2]
var x:Number = 2;
var y:Number = 2;
//
while (row
It depends how you define the rings. It is by distance or by connectedness?

Is 0,0 in the second ring with 1.0 and 0,1?

What is the purpose of knowing this?

Ron

Jiri Heitlager | dadata.org wrote:

Hello list,

I have the following grid and would like to find the neighbouring 
positions of a certain point, going in a radius from in to out, 
covering all the positions.


[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

Let say I take point [2,2] then its neighbours are in the first ring 
[1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't 
got a clue on how to do that.


Can somebody help me?

Thank you,

jiri
___
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] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org
That is a nice solution, but it leaves me with the problem that starting 
from one point (3,2) it only produces a set of points of  ring directly 
around the selected point. I am looking for a solution to get _all_ the 
points, from a certain point and the move in a ring towerds the outside 
of a grid.


Jiri

Merrill, Jason wrote:

This requires you to re-do your grid, but it's one way to handle it
without complex math. It seems a simple way would be to make each row of
the grid an array (the entire thing can be an array as well, but make
each row it's own array).  You could do some object mix-in to ease
syntax and allow for storing complex data types:

myGrid = {row:[{cell:[{id:0},{id:1},{id:2},{id:3}], id:0},
 {cell:[{id:0},{id:1},{id:2},{id:3}], id:1},
 {cell:[{id:0},{id:1},{id:2},{id:3}], id:2},
 {cell:[{id:0},{id:1},{id:2},{id:3}], id:3}]}

(you would make that with for-loops, not necessarily hand-type, though
you could)

So the cell at position 3,2 would be: myGrid.row[2].cell[1] (since
arrays start at 0)

So to get surrounding cells of myGrid.row[2].cell[1], it would be:

myGrid.row[1].cell[0]
myGrid.row[1].cell[1]
myGrid.row[1].cell[2]
myGrid.row[2].cell[0]
myGrid.row[2].cell[2]
myGrid.row[3].cell[0]
myGrid.row[3].cell[1]
myGrid.row[3].cell[2]

In other words, for the cell up and to the left of the current cell, it
would be:

myGrid.row[thisRow.id-1].cell[thisCell.id-1]

the grid cell directly above would be:

myGrid.row[thisRow.id-1].cell[thisCell.id]

the grid cell directly above and to the right would be:

myGrid.row[thisRow.id-1].cell[thisCell.id+1]

the grid cell directly to the left would be:

myGrid.row[thisRow.id].cell[thisCell.id-1]

etc.

get thisRow and thisCell objects with for loops.

for(var i-0; iBank of America  
GT&O Learning & Leadership Development

eTools & Multimedia Team


 


-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf 
Of Jiri Heitlager | dadata.org

Sent: Saturday, June 16, 2007 8:16 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Grid / Math - getting neighbouring positions

Hello list,

I have the following grid and would like to find the 
neighbouring positions of a certain point, going in a radius 

>from in to out, covering all the positions.

[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

Let say I take point [2,2] then its neighbours are in the 
first ring [1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2] I 
manage to get the first ring, but getting the other rings I 
haven't got a clue on how to do that.


Can somebody help me?

Thank you,

jiri
___
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] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org
The ring is defined by distance not by connectedness. It is used for the 
following.
A big image will be split into tiles of 100x100 pixels, that are loaded 
from a server. The total image made of these tiles are loaded in a 
movieclip so that the image is rebuilded. The image is masked by a 
100x100 mask and can be scrolled to left and right. Based on the tile 
that is in the view, i would like to preload the rest of the tiles 
'intelligently'. To do this, i take the current tile and start building 
a loadingQue Array  from there. So first the ring around the current 
tile, the a ring around the first ring and so on, until all the tiles of 
the total image are in the array.


Does that make sense?

JIri

Ron Wheeler wrote:

It depends how you define the rings. It is by distance or by connectedness?

Is 0,0 in the second ring with 1.0 and 0,1?

What is the purpose of knowing this?

Ron

Jiri Heitlager | dadata.org wrote:

Hello list,

I have the following grid and would like to find the neighbouring 
positions of a certain point, going in a radius from in to out, 
covering all the positions.


[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

Let say I take point [2,2] then its neighbours are in the first ring 
[1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't 
got a clue on how to do that.


Can somebody help me?

Thank you,

jiri
___
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] attachMovie from library - fails to work with preloader

2007-06-16 Thread John VanHorn

you must force those movieclips to load before you use have access to them.
what i usually do is to set the export frame for classes to 2, and then go
through the library and uncheck 'export in first frame' for all exported
Mc's. then, on frame 2, make a single key frame and place an instance of all
exported mc's on the stage, but out of view. in frame 1, i'll have a stop
action and preloader code, and when all is loaded, gotoAndPlay frame 3.

On 6/16/07, Alexander Farber <[EMAIL PROTECTED]> wrote:


Dear flash coders,

I've created a class representing playing
cards and it works quite well for me:

  http://preferans.de/flash/Card.as
  http://preferans.de/flash/Card.fla

To reduce the file size (from 300K to 120K),
I don't keep images of complete 32 cards in
the library, but instead I hold the 4 suit images
(spades, hearts, clubs, diamonds) and
4 x 3 pictures (jack, queen and king) there
and then create a card image "on the fly":

public function set index(n:Number):Void {
__index = n;

pic_mc = this.createEmptyMovieClip('pic_mc', 10);

var depth:Number = 10;
var rank:Number = CARDS[n].rank;
var suit:Number = CARDS[n].suit;
var color:String = suit < DIAMONDS ? 'Black' : 'Red';

var eye:String = (UNKNOWN == rank ||
(JACK <= rank && rank <= KING)) ?
CARDS[n].label : eye = SUITS[suit];
for (var key:String in EYE_POS[rank]) {
var pos_obj:Object = EYE_POS[rank][key];
pic_mc.attachMovie(eye,
eye + depth + '_mc', depth++, pos_obj);
}
// ...and so on: attach 2 card indices in the corners
  }

Those suits and jack-queen-king images are all
MovieClips in the library, with the following settings:

Identifier: Hearts
Class:
Export for ActionScript [X]
Export for runtime sharing [_]
Export in first frame [X]

My problem is that when I'm trying to postpone loading
those MovieClips by unchecking the "Export in 1st frame"
and by setting File->Publish Settings...->Flash->
ActionScript 2.0->Settings...->Export Frame for Classes
to 2 or 10, then my movie stops working: the cards are
empty, no suits and no jack-queen-kings are shown.

Also my preloader TextField only show ups shortly :-(

Does it make any sense to convert the MovieClips
to Graphics in the library? The "Export in 1st frame"
check box is (sometimes???) greyed out then...

Thank you
Alex

PS: Here is the code from my Actions layer (to be
  found in http://preferans.de/flash/Card.fla )

stop();

var depth:Number = 10;

var load_txt:TextField = this.createTextField('load_txt',
depth++, Stage.width / 2, Stage.height / 2, 300, 100);

onEnterFrame = function() {
var loaded:Number = getBytesLoaded();
var total:Number = getBytesTotal();

load_txt.text = loaded + ' / ' + total;

if (loaded >= total && loaded > 100) {
delete onEnterFrame;
gotoAndPlay('MAIN');
}
};

 And in the frame "MAIN" ///

stop();

load_txt._visible = false;

for (var i:Number = 0; i < Card.CARDS.length; i++) {
var card_mc:MovieClip = this.attachMovie('Card', 'card' + i +
'_mc', depth++);
with (card_mc) {
index = i;
_x = card_mc._width / 2 +
Math.floor(Math.random() * (Stage.width -
card_mc._width));
_y = card_mc._height / 2 +
Math.floor(Math.random() * (Stage.height -
card_mc._height));
_rotation = Math.floor(Math.random() * 9 - 4);

addEventListener('clicked', this);
}
}

function clicked(evt_obj:Object):Void {
var card_mc:MovieClip = evt_obj.target;

// put the clicked card at the top
card_mc.swapDepths(depth++);
}
___
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





--
John Van Horn
[EMAIL PROTECTED]
___
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] Grid / Math - getting neighbouring positions

2007-06-16 Thread Merrill, Jason
This requires you to re-do your grid, but it's one way to handle it
without complex math. It seems a simple way would be to make each row of
the grid an array (the entire thing can be an array as well, but make
each row it's own array).  You could do some object mix-in to ease
syntax and allow for storing complex data types:

myGrid = {row:[{cell:[{id:0},{id:1},{id:2},{id:3}], id:0},
 {cell:[{id:0},{id:1},{id:2},{id:3}], id:1},
 {cell:[{id:0},{id:1},{id:2},{id:3}], id:2},
 {cell:[{id:0},{id:1},{id:2},{id:3}], id:3}]}

(you would make that with for-loops, not necessarily hand-type, though
you could)

So the cell at position 3,2 would be: myGrid.row[2].cell[1] (since
arrays start at 0)

So to get surrounding cells of myGrid.row[2].cell[1], it would be:

myGrid.row[1].cell[0]
myGrid.row[1].cell[1]
myGrid.row[1].cell[2]
myGrid.row[2].cell[0]
myGrid.row[2].cell[2]
myGrid.row[3].cell[0]
myGrid.row[3].cell[1]
myGrid.row[3].cell[2]

In other words, for the cell up and to the left of the current cell, it
would be:

myGrid.row[thisRow.id-1].cell[thisCell.id-1]

the grid cell directly above would be:

myGrid.row[thisRow.id-1].cell[thisCell.id]

the grid cell directly above and to the right would be:

myGrid.row[thisRow.id-1].cell[thisCell.id+1]

the grid cell directly to the left would be:

myGrid.row[thisRow.id].cell[thisCell.id-1]

etc.

get thisRow and thisCell objects with for loops.

for(var i-0; i>-Original Message-
>>From: [EMAIL PROTECTED] 
>>[mailto:[EMAIL PROTECTED] On Behalf 
>>Of Jiri Heitlager | dadata.org
>>Sent: Saturday, June 16, 2007 8:16 AM
>>To: flashcoders@chattyfig.figleaf.com
>>Subject: [Flashcoders] Grid / Math - getting neighbouring positions
>>
>>Hello list,
>>
>>I have the following grid and would like to find the 
>>neighbouring positions of a certain point, going in a radius 
>>from in to out, covering all the positions.
>>
>>[0,0] [1,0] [2,0] [3,0] [4,0]
>>[0,1] [1,1] [2,1] [3,1] [4,1]
>>[0,2] [1,2] [2,2] [3,2] [4,2]
>>[0,3] [1,3] [2,3] [3,3] [4,3]
>>[0,4] [1,4] [2,4] [3,4] [4,4]
>>
>>Let say I take point [2,2] then its neighbours are in the 
>>first ring [1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2] I 
>>manage to get the first ring, but getting the other rings I 
>>haven't got a clue on how to do that.
>>
>>Can somebody help me?
>>
>>Thank you,
>>
>>jiri
>>___
>>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] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jobe Makar

Hi Jiri,

There is an algorithm called Bresenham's Line Algorithm. It is used by 
computers to determine which pixels to display based on a line. It is also 
used by game programmers to determine the # of tiles crossed along the path 
of a moving object (or in raycasting, etc). There exists a "circle variant" 
of this algorithm that can achieve what you're trying to do. Perhaps it is 
too much work to implement, but I thought I'd let you know that it is 
described on Wikipedia:


http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

Jobe Makar
http://www.electrotank.com
http://www.electro-server.com
phone: 252-627-8026
mobile: 919-609-0408
fax: 919-882-1121
- Original Message - 
From: "Jiri Heitlager | dadata.org" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, June 16, 2007 8:15 AM
Subject: [Flashcoders] Grid / Math - getting neighbouring positions



Hello list,

I have the following grid and would like to find the neighbouring 
positions of a certain point, going in a radius from in to out, covering 
all the positions.


[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

Let say I take point [2,2] then its neighbours are in the first ring [1,1] 
[2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't got 
a clue on how to do that.


Can somebody help me?

Thank you,

jiri
___
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] Grid / Math - getting neighbouring positions

2007-06-16 Thread Ron Wheeler

It depends how you define the rings. It is by distance or by connectedness?

Is 0,0 in the second ring with 1.0 and 0,1?

What is the purpose of knowing this?

Ron

Jiri Heitlager | dadata.org wrote:

Hello list,

I have the following grid and would like to find the neighbouring 
positions of a certain point, going in a radius from in to out, 
covering all the positions.


[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

Let say I take point [2,2] then its neighbours are in the first ring 
[1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't 
got a clue on how to do that.


Can somebody help me?

Thank you,

jiri
___
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] Grid / Math - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org

Hello list,

I have the following grid and would like to find the neighbouring 
positions of a certain point, going in a radius from in to out, covering 
all the positions.


[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

Let say I take point [2,2] then its neighbours are in the first ring 
[1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't 
got a clue on how to do that.


Can somebody help me?

Thank you,

jiri
___
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] Grid - getting neighbouring positions

2007-06-16 Thread Jiri Heitlager | dadata.org

[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

I have the following grid and would like to find the neighbouring 
positions of a certain point, going in a radius from in to out, covering 
all the positions.


Let say I take point [2,2] then its neighbours are in the first ring 
[1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't 
got a clue on how to do that.


Can somebody help me?

Thank you,

jiri
___
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] Mathematics specialist - trigonometry

2007-06-16 Thread dr.ache

zoomify.com

not really expensive...

greetz

Jiri Heitlager | dadata.org schrieb:

Hello list,

I have a client that wants something like this:
http://www.wdcs.co.uk/media/flash/whalebanner/content_pub_en.html

Basically a huge image is split into tiles, and each load a tileImage.
The user can drag a navigator (small view in ratio) over the image. It
can occur that the tiles under the view are not loaded yet. To deal with
this I need to know wich tiles are visable, after the user has moved the
navigator and then load the corresponding image in at the position.
Becuase the amount of tiles, can become quit big I dont want to loop
through all the tile MovieClips to find out the closestby. I have a
feeling trignomotry is the way to ga, but am poor in Mathmatics. In my
example you will find a image with 100x100 movieclip tiles. This is just
for testing, because in the end I would like to dynamically
createMovieClips on there right location. So I actually need to find out
locations [x,y] that are visible.

I uploaded some files and hope someone will take the time to dowlaod
them and help me with finding a solution.

Here is a view:
http://playground.dadata.org/trig/test_01.swf

and here the .fla can be downloaded
http://playground.dadata.org/trig/test_01.fla

Many thnx

Jiri


___
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] Mathematics specialist - trigonometry

2007-06-16 Thread Jiri Heitlager | dadata.org

Hello list,

I have a client that wants something like this:
http://www.wdcs.co.uk/media/flash/whalebanner/content_pub_en.html

Basically a huge image is split into tiles, and each load a tileImage.
The user can drag a navigator (small view in ratio) over the image. It
can occur that the tiles under the view are not loaded yet. To deal with
this I need to know wich tiles are visable, after the user has moved the
navigator and then load the corresponding image in at the position.
Becuase the amount of tiles, can become quit big I dont want to loop
through all the tile MovieClips to find out the closestby. I have a
feeling trignomotry is the way to ga, but am poor in Mathmatics. In my
example you will find a image with 100x100 movieclip tiles. This is just
for testing, because in the end I would like to dynamically
createMovieClips on there right location. So I actually need to find out
locations [x,y] that are visible.

I uploaded some files and hope someone will take the time to dowlaod
them and help me with finding a solution.

Here is a view:
http://playground.dadata.org/trig/test_01.swf

and here the .fla can be downloaded
http://playground.dadata.org/trig/test_01.fla

Many thnx

Jiri


___
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] attachMovie from library - fails to work with preloader

2007-06-16 Thread Alexander Farber

Dear flash coders,

I've created a class representing playing
cards and it works quite well for me:

 http://preferans.de/flash/Card.as
 http://preferans.de/flash/Card.fla

To reduce the file size (from 300K to 120K),
I don't keep images of complete 32 cards in
the library, but instead I hold the 4 suit images
(spades, hearts, clubs, diamonds) and
4 x 3 pictures (jack, queen and king) there
and then create a card image "on the fly":

public function set index(n:Number):Void {
__index = n;

pic_mc = this.createEmptyMovieClip('pic_mc', 10);

var depth:Number = 10;
var rank:Number = CARDS[n].rank;
var suit:Number = CARDS[n].suit;
var color:String = suit < DIAMONDS ? 'Black' : 'Red';

var eye:String = (UNKNOWN == rank ||
(JACK <= rank && rank <= KING)) ?
CARDS[n].label : eye = SUITS[suit];
for (var key:String in EYE_POS[rank]) {
var pos_obj:Object = EYE_POS[rank][key];
pic_mc.attachMovie(eye,
eye + depth + '_mc', depth++, pos_obj);
}
   // ...and so on: attach 2 card indices in the corners
 }

Those suits and jack-queen-king images are all
MovieClips in the library, with the following settings:

   Identifier: Hearts
   Class:
   Export for ActionScript [X]
   Export for runtime sharing [_]
   Export in first frame [X]

My problem is that when I'm trying to postpone loading
those MovieClips by unchecking the "Export in 1st frame"
and by setting File->Publish Settings...->Flash->
ActionScript 2.0->Settings...->Export Frame for Classes
to 2 or 10, then my movie stops working: the cards are
empty, no suits and no jack-queen-kings are shown.

Also my preloader TextField only show ups shortly :-(

Does it make any sense to convert the MovieClips
to Graphics in the library? The "Export in 1st frame"
check box is (sometimes???) greyed out then...

Thank you
Alex

PS: Here is the code from my Actions layer (to be
 found in http://preferans.de/flash/Card.fla )

stop();

var depth:Number = 10;

var load_txt:TextField = this.createTextField('load_txt',
depth++, Stage.width / 2, Stage.height / 2, 300, 100);

onEnterFrame = function() {
var loaded:Number = getBytesLoaded();
var total:Number = getBytesTotal();

load_txt.text = loaded + ' / ' + total;

if (loaded >= total && loaded > 100) {
delete onEnterFrame;
gotoAndPlay('MAIN');
}
};

 And in the frame "MAIN" ///

stop();

load_txt._visible = false;

for (var i:Number = 0; i < Card.CARDS.length; i++) {
var card_mc:MovieClip = this.attachMovie('Card', 'card' + i + '_mc', 
depth++);
with (card_mc) {
index = i;
_x = card_mc._width / 2 +
Math.floor(Math.random() * (Stage.width - card_mc._width));
_y = card_mc._height / 2 +
Math.floor(Math.random() * (Stage.height - 
card_mc._height));
_rotation = Math.floor(Math.random() * 9 - 4);

addEventListener('clicked', this);
}
}

function clicked(evt_obj:Object):Void {
var card_mc:MovieClip = evt_obj.target;

// put the clicked card at the top
card_mc.swapDepths(depth++);
}
___
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] Repost: Movie Explorer question

2007-06-16 Thread Muzak
Only stage assets.
So just drop everything in the Lib in a keyframe on stage.

- Original Message - 
From: "Jonathan Berry" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Saturday, June 16, 2007 2:51 AM
Subject: [Flashcoders] Repost: Movie Explorer question


> Hey, did anyone have any ideas about this? Sorry for the bother. Thanks
> again.
>
> -- Forwarded message --
> From: Jonathan Berry <[EMAIL PROTECTED]>
> Date: Jun 13, 2007 3:20 PM
> Subject: Movie Explorer question
> To: Flashcoders mailing list 
>
> Hello all!
> I have a general question about the Movie Explorer. I like it quite a bit
> because we receive FLAs from our partners or third parties that have code
> hidden in them at different locations [that nasty object(i.e . mc or
> button)-based coding that I tend to shy away from especially]. However, when
> an mc or button is attached from the library it appears that code within the
> objects is not displayed in the movie explorer. Is there a way to set the
> explorer to display this code when present? I have checked on and off all
> the options in the interface and have found no way to do this. We are still
> using Flash 8, so I don't know if they added this support in the newest
> interface. Thanks so much.
>
> -- 
> Jonathan Berry, M.A.


___
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] - Array memory performance

2007-06-16 Thread Adrian Lynch
He meant that the line:

my_array.push(z)=z;

should be:

my_array.push(z);

You're right about recreating the array, you could leave out the delete
my_array and just overwrite it with new Array().

Adrian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Cristo @
cryzto.ch
Sent: 18 May 2007 00:31
To: 'Rákos Attila'; flashcoders@chattyfig.figleaf.com
Subject: AW: [Flashcoders] - Array memory performance


Thnx for the info Attila.

Well my plan was to fill up the array with object's-name that are visible in
the configurator (active ones) cause the invisibles ( _alpha = .25 ) are not
important for the user (inactive ones).

The thing with the low-level memory ist hat I don't know how Flash handles
it, in C++ the Developer ist he one to manage that problem. But I guess u're
saying it works more or less like Java (with a garbage-collector) since it
works on VM.

>> Yes, it is wrong of course, since only a variable or property can be
>> on the left side of an assignment. What do you want to do with this?
>> I don't understand it at all. push() returns the new length of the
>> array - what do you want to assign to it?

Sorry, but I don't know which assignement you exactly refer to, do you mean
" my_array.push(z)=z; "?

It's only a test-code to show me a value has been stored in the array.

Thnx 4 that quick answer Attila.

Cryzto ;-)

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Rákos
Attila
Gesendet: Freitag, 18. Mai 2007 00:27
An: Cristo @ cryzto.ch
Betreff: Re: [Flashcoders] - Array memory performance


Ccc> Is in the following code something wrong:
Ccc>
Ccc> var my_array:Array = new Array();
Ccc>
Ccc> for (var z=0; z my_array.push(z)=z;
Ccc> }

Yes, it is wrong of course, since only a variable or property can be
on the left side of an assignment. What do you want to do with this?
I don't understand it at all. push() returns the new length of the
array - what do you want to assign to it?

Ccc> I’m rather skilled in C++, and there I have to do that for not
overfilling
Ccc> dynamic memory (heap)!

What do you have to do there? In general you don't have to care about
low-level memory management in Flash at all, the VM is responsible for
such tasks.

Ccc> I want to fill up an array and later empty it so i can fill it again
from
Ccc> scratch, Important is I don’t want to empty the array element by
element
Ccc> using a loop.

No loop is required, a simple splice(0) is enough. Or you can create a new
array instance, too - of course.

  Attila

___
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] How can we sum to dates???

2007-06-16 Thread jtgxbass

Just use flash's Date class and work with milliseconds...

var startDate = new Date(2007,0,14,11,30,0,0);
var duration = 50 * 60 * 1000; // in milliseconds
var endDate = new Date(startDate.getTime() + duration);




On 6/16/07, eka <[EMAIL PROTECTED]> wrote:


Hello :)

i have update my SVN repository and add a new feature in the static "add"
method of the Calendar class :

import asgard.date.Calendar ;

var begin:Calendar = new Calendar( 2007, 5 , 14, 11, 30, 0 ) ;

var duration:Number = 50 ;

var end:Calendar = Calendar.add( begin, Calendar.MINUTE , 50 ) ;

var sBegin:String = begin.format("MM dd  hh:nn:ss") ;
var sFinish:String   = end.format("MM dd  hh:nn:ss") ;

trace( "start  : " + sBegin ) ;
trace( "finish : " + sFinish ) ;

It's more easy now ;)

EKA+ :)

2007/6/16, eka <[EMAIL PROTECTED]>:
>
> Hello :)
>
> if you have 2 minutes :
>
> 1 - install VEGAS my opensource framework and this extensions :
>
> - page project : http://code.google.com/p/vegas/
> - install VEGAS :
http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN
>
> 2 - Use the Calendar and the Time class in the asgard package :
>
> asgard.date.Calendar :
>
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/asgard/date/Calendar.as
> asgard.date.Time   :
> http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/asgard/date/Time.as
>
>
> Example :
> import asgard.date.Calendar ;
> import asgard.date.Time ;
>
> var begin:Calendar = new Calendar( 2007, 5 , 14, 11, 30, 0 ) ;
>
> var duration:Number = 50 * Time.MINUTE ; // in milliseconds
>
> var end:Calendar = new Calendar( begin.valueOf() + duration ) ;
>
> var sBegin:String = begin.format("MM dd  hh:nn:ss") ;
> var sFinish:String   = end.format("MM dd  hh:nn:ss") ;
>
> trace( "start  : " + sBegin ) ; // start  : Jun 14 2007 11:30:00
> trace( "finish : " + sFinish ) ; // finish : Jun 14 2007 12:20:00
>
>
> EKA+ :)
>
>
>
> var end:Calendar = Calendar.add( begin , Calendar.MINUTES
>
>
> 2007/6/16, Amandeep Singh <[EMAIL PROTECTED]>:
> >
> > Hi everyone,
> >
> > I got stuck in a problem. What i need is to sum to dates.
> >
> > Let say there is an event that starts at Jun 14 2007 11:30:00. The
> > duration
> > of the event is 50 min. That means the end time will be Jun 14 2007
> > 12:20:00.
> >
> > Now what i need is to sum the start time and the duration to get the
end
> > time.
> >
> > Anyone who know how to do this please let me know. I will be very
> > thankful.
> >
> > Thanks in Advance.
> >
> > Regards,
> > Amandeep
> >
> > ___
> > 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] How can we sum to dates???

2007-06-16 Thread eka

Hello :)

i have update my SVN repository and add a new feature in the static "add"
method of the Calendar class :

import asgard.date.Calendar ;

var begin:Calendar = new Calendar( 2007, 5 , 14, 11, 30, 0 ) ;

var duration:Number = 50 ;

var end:Calendar = Calendar.add( begin, Calendar.MINUTE , 50 ) ;

var sBegin:String = begin.format("MM dd  hh:nn:ss") ;
var sFinish:String   = end.format("MM dd  hh:nn:ss") ;

trace( "start  : " + sBegin ) ;
trace( "finish : " + sFinish ) ;

It's more easy now ;)

EKA+ :)

2007/6/16, eka <[EMAIL PROTECTED]>:


Hello :)

if you have 2 minutes :

1 - install VEGAS my opensource framework and this extensions :

- page project : http://code.google.com/p/vegas/
- install VEGAS : http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN

2 - Use the Calendar and the Time class in the asgard package :

asgard.date.Calendar :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/asgard/date/Calendar.as
asgard.date.Time   :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/asgard/date/Time.as


Example :
import asgard.date.Calendar ;
import asgard.date.Time ;

var begin:Calendar = new Calendar( 2007, 5 , 14, 11, 30, 0 ) ;

var duration:Number = 50 * Time.MINUTE ; // in milliseconds

var end:Calendar = new Calendar( begin.valueOf() + duration ) ;

var sBegin:String = begin.format("MM dd  hh:nn:ss") ;
var sFinish:String   = end.format("MM dd  hh:nn:ss") ;

trace( "start  : " + sBegin ) ; // start  : Jun 14 2007 11:30:00
trace( "finish : " + sFinish ) ; // finish : Jun 14 2007 12:20:00


EKA+ :)



var end:Calendar = Calendar.add( begin , Calendar.MINUTES


2007/6/16, Amandeep Singh <[EMAIL PROTECTED]>:
>
> Hi everyone,
>
> I got stuck in a problem. What i need is to sum to dates.
>
> Let say there is an event that starts at Jun 14 2007 11:30:00. The
> duration
> of the event is 50 min. That means the end time will be Jun 14 2007
> 12:20:00.
>
> Now what i need is to sum the start time and the duration to get the end
> time.
>
> Anyone who know how to do this please let me know. I will be very
> thankful.
>
> Thanks in Advance.
>
> Regards,
> Amandeep
>
> ___
> 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