Re: [Flashcoders] Letting go of AS2 for AS3

2006-11-15 Thread David Buff

Hi

I didn't try yet to code in AS3 with Flash9. I choose to develop with Flex2. 
I don't know now all about AS3 but:


With Flex, I build a kind of main class, like all other classes, but without 
constructor. My app in MXML (only 4 lines of code) just define what is the 
main class and whitch method of this class it does to call first. After 
that, all is in AS3. My classes and also my main class are coded in *.as 
files.
I've seen in Flash9 that with FilePublish settingsFlashActionsScript 
version: ActionScript3.0Settings, you can define a single document class. 
It seem's to be the main class whitch start playing the swf.
I tryed quickly to build an app with it, but it didn't start... sorry to 
can't help you more...


I hope I bring a few light in your mind...

David Buff


- Original Message - 
From: Lori Hutchek [EMAIL PROTECTED]

To: flashcoders@chattyfig.figleaf.com
Sent: Tuesday, November 14, 2006 8:24 PM
Subject: [Flashcoders] Letting go of AS2 for AS3


Okay im in the middle of reading AS3 Cookbook, and Essential AS3. And i'm 
having some trouble grasping the concept of the main class file {as in the 
root package for the program you are constructing}, both books talk about 
this. But are they talking about constructing applications using MTASC/mxmlc 
compilers or is there a way using the Flash 9 IDE to create a main class 
file that the IDE needs to look for. I know u can write code on the 
timeline, of course, but just wondering if there some other way which they 
are elluding to, and me being slow am just not gettin'...


Thanks!
Lori-

___
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] Mouse and ActionScript3

2006-11-10 Thread David Buff

Hi list...

Sorry for this so simple question... but I didn't find an easy way to 
replace onReleaseOutside event in ActionScript3. The MOUSE_UP event doesn't 
fire if the mouse is outside the displayObject...
So I test the MOUSE_UP event of the root display object, and transfer the 
value to my object... but it's not a nice solution...


Any idea ??
thanks

David Buff

___
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] efficient line segment intersection algorithm?

2006-11-09 Thread David Buff

Hi

I test myself with only lines in the two movieClips, hitTest works fine 
without fills...


David Buff

- Original Message - 
From: Millie Niss [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, November 09, 2006 4:01 AM
Subject: [Flashcoders] efficient line segment intersection algorithm?


As part of an app I'm writing, I need users to be able to manipulate a 
drawing of a graph:   Specifically, I have a bunch of circles (nodes) 
connected to each other by line segments (edges).  Users can drag the 
nodes around within a fixed area (this part works), but I need to stop 
them from making the edges intersect each other (except where they meet at 
the nodes).


I tried to do this using MovieClip.hitTest (each edge is its own 
MovieClip, and I know the coordinates of all the nodes) but it didn't 
work.  I am sure there is a bug in my code, which I need to find.


Even if I fix it, however, the stupid algorithm that goes through every 
node and checks if it hits any edge in the obvious (2 nested for loops) 
way is horribly inefficient -- I probably need to do the math myself 
rather than relying on hitTest.  The number of nodes is user-configurable 
so even if I get the stupid algorithm to work on my baby test case, I am 
worried that it won't scale.


It occurred to me that possibly hitTest doesn't work to check whether a 
point intersects with a clip that has strokes but no fills (ie my 
edges)... Does hitTest use the pixels of strokes or does it only use the 
insides of fills as the area it checks the test point against?


Millie Niss
[EMAIL PROTECTED]
http://www.sporkworld.org
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Q:Playing with BitmapData

2006-10-23 Thread David Buff

Hi

I didn't find a better solution than two x and y loops... (other loop 
solutions I tested are not faster)


Just note than copyChannel is a method 3x slower than copyPixels

If you need to loop on your BitmapData, may be doing a setPixel inside the 
loop to build your channel Bitmap is more faster than doing your loop and 
then 3 copyChannel...


The better method I found (the fastest) to get or set r,v,b components when 
you extract a color with getPixel is:


to get color:
arvb = 
{alpha:color24,red:(color16)%256,green:(color8)%256,blue:color%256};


to set color:
color = (alpha8)+red)8)+green)8)+blue;

good luck

David Buff


- Original Message - 
From: [EMAIL PROTECTED]

To: flashcoders@chattyfig.figleaf.com
Sent: Sunday, October 22, 2006 4:49 AM
Subject: [Flashcoders] Q:Playing with BitmapData



Hi
There are two things I am trying to do with bitmap data.
The first is to analyze every pixel in an image using getpixel and then 
store this info as xml data for later manipulation.


Can anyone offer suggestions to speed up this process?

The second techinique is to simulate splitting up an image into its 
corresponding red, green and blue channels, showing how a 'true color' 
image is achieved when these three channels perfectly overlap one another.


Do I simply need to use the Copychannel method of the BitmapData object 
for this?


Thanks in advance!
Jim Bachalo

[e] jbach at bitstream.ca
[c] 416.668.0034
[w] www.bitstream.ca

...all improvisation is life in search of a style.
- Bruce Mau,'LifeStyle'
___
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] find same label

2006-10-23 Thread David Buff

Sorry, more simple:

don't push in a array and cast the array as string... just push in a string 
like:


var myString:String = 

and

myString+=value;

David Buff

- Original Message - 
From: David Buff [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Monday, October 23, 2006 5:32 PM
Subject: Re: [Flashcoders]  find same label



Hi

I'll do something like this.

First create a empty array. Then loop into your ComboBox like I show you 
before. Each step of the loop, test if the value is allready in the array. 
There is no method of array class to do that, but you can cast the array 
as string and use the method indexOf of the string class, something like 
this:


if (myArray.toString().indexOf(myValue)==-1) { ...

-1 means that the value is not in the string, then it's the first 
occurence of this value. So push the value into the array for futur test 
and push also this value into your second ComboBox.


If the value appears again, indexOf will return a positiv or 0 number, 
then it's not pushed into your second ComboBox.


David Buff


- Original Message - 
From: Laurent CUCHET [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Monday, October 23, 2006 12:28 PM
Subject: [Flashcoders]  find same label


Is there a way to find same la bel in a combobox and let only one same 
label

??

my_cb.addItem({data:1, label:One});
my_cb.addItem({data:2, label:Two});
my_cb.addItem({data:3, label:One});
my_cb.addItem({data:4, label:Two});


var cbListener:Object = new Object();
cbListener.change = function (evt_obj:Object) {
trace(Currently selected item is:  + 
evt_obj.target.selectedItem.label);

}
my_cb.addEventListener(change, cbListener);
___
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] Bitmap filters

2006-10-19 Thread David Buff
To invert your image, just create a MovieClip in your library, then put your 
picture inside, and link this MovieClip with the id: picture_id.


the code is:

import flash.filters.ColorMatrixFilter;

var matrix:Array = new Array();
matrix = matrix.concat([-1, 0, 0, 0, 256]); // red
matrix = matrix.concat([0, -1, 0, 0, 256]); // green
matrix = matrix.concat([0, 0, -1, 0, 256]); // blue
matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha

var filter:ColorMatrixFilter = new ColorMatrixFilter(matrix);

_root.attachMovie(picture_id,pictureMc,1,{x:10,y:10});
pictureMc.filters = new Array(filter);

To understand:
I you take the exemple of a 100% red picture, you've red=256, green=0, 
blue=0. The invert of the red is cyan: red=0, green=256, blue=256


Then reed the oline help of colorMatrixFilter, you can see that:

redResult = a[0] * srcR + a[1] * srcG + a[2] * srcB + a[3] * srcA + a[4]

so the first line of your matrix is -1,0,0,0,256 so redResult = -1*srcR + 0 
+ 0 + 0 + 256 -- srcR = 256 and -256 + 256 = 0 the result is 0
so the second line of your matrix is 0,-1,0,0,256 so redResult = 0 + -1*srcG 
+ 0 + 0 + 256 -- srcG = 0 and 0 + 256 = 0 the result is 256

same for blue.

Your global result is red=0,green=256,blue=256 it's a invert image.

- Original Message - 
From: Keith Reinfeld [EMAIL PROTECTED]

To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
Sent: Wednesday, October 18, 2006 9:54 PM
Subject: RE: [Flashcoders] Bitmap filters



Randy,

You can use ColorTransform to invert colors:

// code
stop();

import flash.geom.ColorTransform;
import flash.geom.Transform;

toggleClr_btn.label.text = Invert;
toggleClr_btn.onRelease = toggleClr;

var imgClr:Transform = new Transform(image_mc);
var toggleFlag:Boolean = false;
function toggleClr():Void{
toggleFlag = !toggleFlag;
if(toggleFlag){
// invert
var clrTrans:ColorTransform = new ColorTransform(-1, -1, -1,
1, 255, 255, 255, 0);
imgClr.colorTransform = clrTrans;
}else{
// restore
var clrTrans:ColorTransform = new ColorTransform(1, 1, 1, 1,
0, 0, 0, 0);
imgClr.colorTransform = clrTrans;
}
}

HTH

-Keith
http://home.mn.rr.com/keithreinfeld



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Randy 
Tinfow

Sent: Wednesday, October 18, 2006 12:07 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Bitmap filters

Having a hard time understanding the new bitmap filters, specifically
the color matrix filter.  We want to programmatically invert an image's
colors.  Is there any documentation that explains the color matrix
properties succintctly?  Or provides step-by-step instructions on it's
application?

Thanks,

Randy Tinfow
IMAGE PLANT
___
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] AS 3.0 - Loader.load() a .swf and than control it

2006-10-19 Thread David Buff
I'm a little confused also about loading swf a control it. I didn't 
succeeded. But I've readed somewhere that you can not import swf compiled in 
as2 in a as3 loader, because the classes witch define the movieclip is 
different. But I remember there is another class especially for as2 
movieclip... sorry, my licence expired, and I didn't recept the Flex 2.0 I 
by...


Speak again about that when I get my new licence

David Buff

- Original Message - 
From: Dave Geurts [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Wednesday, October 18, 2006 10:31 PM
Subject: [Flashcoders] AS 3.0 - Loader.load() a .swf and than control it


I am a little confused with loading media into the loader object.

I can load a swf in fine but than how do you control that swf's timline? I 
think that the swf gets loaded into a loader object, that has a display 
container? Im a little lost with the loader object concept.



I assumend it would be loader.getChildAt(0)

i saw loader.content in there but not sure what that does.

---
var introLoader:Loader = new Loader();

var request:URLRequest = new URLRequest(intro.swf);
introLoader.load(request);


trace(introLoader.content);
---
Intro loads fine and starts playing
Trace returns null

Another question is can you load in a .swf that was compiled in 2.0 even if 
it has no AS in it and control its timeline?



thanks for your time!

-Dave







___
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] attachbitmap and copy pixels.

2006-10-19 Thread David Buff

Hi,

Just create a fla and import a picture (jpg)  in the librairy (minimum 
150,150). Link this picture with the id: picture_id

Then try this code.

import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;

var picture:BitmapData = BitmapData.loadBitmap(picture_id);
_root.createEmptyMovieClip(pictureMc,1);
pictureMc.attachBitmap(picture,1);

var subPicture:BitmapData = new BitmapData(100,100,false,0xFF);
_root.createEmptyMovieClip(subPictureMc,2);
subPictureMc.attachBitmap(subPicture,1);

var xPos:Number = 50;
var yPos:Number = 50;
var borderSize:Number = 10;

subPictureMc.onRelease = function() {
subPicture.copyPixels(picture,new 
Rectangle(xPos,yPos,subPicture.width-borderSize*2,subPicture.height-borderSize*2),new 
Point(borderSize,borderSize));

}

Your picture must be displayed. A red box will appear on it. Then click on 
the red box, a part of your picture is drawed into the red box.
Change the xPos, yPos and borderSize. You'll be abble to anderstand 
copyPixels with this exemple.


(but it don't show how to use the alpha channel... another time, when you'll 
be familiar with this)


enjoy,

David Buff

- Original Message - 
From: Johnny Zen [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 10:40 AM
Subject: [Flashcoders] attachbitmap and copy pixels.



Hi all

Can anyone give me a super simple example on using copypixels to take
a snapshot of a jpg within a movie clip. I'm having trouble
understanding the examples of bitmapdata and copypixels.

It would be a great help for me.


Best wishes


Johnny
___
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] attachbitmap and copy pixels.

2006-10-19 Thread David Buff

Just explain a little more...

subPicture.copyPixels(picture,new 
Rectangle(xPos,yPos,subPicture.width-borderSize*2,subPicture.height-borderSize*2),new 
Point(borderSize,borderSize));


It's mean:

-subPicture is the BitmapData where you want to copy the pixels
-copyPixels is a method of BitmapData object
-picture is the BitmapData witch is the source of pixels
-new Rectangle is a flash.geom.Rectangle object, witch define the top left 
point of the part of the source picture (inside the BitmapData here called 
picture) you want to copy, and the width and the height of this rectangle
-new Point is a flash.geom.Point object witch define the top left point 
inside the destination BitmapData where you want to copy your pixels 
(usually (0,0) but you can choose something else)


David Buff

- Original Message - 
From: David Buff [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 11:05 AM
Subject: Re: [Flashcoders] attachbitmap and copy pixels.



Hi,

Just create a fla and import a picture (jpg)  in the librairy (minimum 
150,150). Link this picture with the id: picture_id

Then try this code.

import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;

var picture:BitmapData = BitmapData.loadBitmap(picture_id);
_root.createEmptyMovieClip(pictureMc,1);
pictureMc.attachBitmap(picture,1);

var subPicture:BitmapData = new BitmapData(100,100,false,0xFF);
_root.createEmptyMovieClip(subPictureMc,2);
subPictureMc.attachBitmap(subPicture,1);

var xPos:Number = 50;
var yPos:Number = 50;
var borderSize:Number = 10;

subPictureMc.onRelease = function() {
subPicture.copyPixels(picture,new 
Rectangle(xPos,yPos,subPicture.width-borderSize*2,subPicture.height-borderSize*2),new 
Point(borderSize,borderSize));

}

Your picture must be displayed. A red box will appear on it. Then click on 
the red box, a part of your picture is drawed into the red box.
Change the xPos, yPos and borderSize. You'll be abble to anderstand 
copyPixels with this exemple.


(but it don't show how to use the alpha channel... another time, when 
you'll be familiar with this)


enjoy,

David Buff

- Original Message - 
From: Johnny Zen [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 10:40 AM
Subject: [Flashcoders] attachbitmap and copy pixels.



Hi all

Can anyone give me a super simple example on using copypixels to take
a snapshot of a jpg within a movie clip. I'm having trouble
understanding the examples of bitmapdata and copypixels.

It would be a great help for me.


Best wishes


Johnny
___
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] attachbitmap and copy pixels.

2006-10-19 Thread David Buff
My english's not so good as I would like... Would like to help you but, 
could you be a little more understandable (for a frenchy) ??


- Original Message - 
From: Johnny Zen [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 2:04 PM
Subject: Re: [Flashcoders] attachbitmap and copy pixels.



any help on this anyone?

thanks


Johnny
___
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] ComboBox

2006-10-19 Thread David Buff

Just put a button called button on your stage... and code:

One_cb.addItem({data:1, label:One});
One_cb.addItem({data:2, label:Two});
One_cb.addItem({data:3, label:Hello});
One_cb.addItem({data:4, label:Yes});
One_cb.addItem({data:5, label:It works});

button.onRelease = function():Void {
   for (var i:Number=0;iOne_cb.length;i++) {
  var subObject:Object = One_cb.getItemAt(i);
  var itemObject:Object = new Object();
  trace(--);
  for (var j:String in subObject) {
  trace(j: +j+--+subObject[j]);
  itemObject[j] = subObject[j];
  }
  Two_cb.addItem(itemObject);
   }
}

May be there is something more simple...

David Buff

- Original Message - 
From: Laurent CUCHET [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 2:15 PM
Subject: [Flashcoders]  ComboBox



There is 2 combobox on the stage, One_cb and two_cb

One_cb.addItem({data:1, label:One});
One_cb.addItem({data:2, label:Two});

How can I do to fill two_cb (data and label) with a button ?

Thank you for your tips, Laurent
___
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] Boolean question

2006-10-19 Thread David Buff
I think it's because q.zoomed = false create a memory space where the 
boolean value flase is stored, and q.zoomed is a pointer witch point to 
this memory space.
New Boolean(false) create also a memory space and a pointer, but with 
w.zoomed = new Boolean(false) , w.zoomed point to the pointer of the value 
and don't point to the value. So you can do !Boolean but not !Pointer(of 
boolean)...


w = new Object();
w.zoomed = new Boolean(false);
trace (w.zoomed);
//false
w.zoomed = !(w.zoomed);
trace (w.zoomed);
//false

test = !(w.zoomed);
trace(test);

test is a pointer to a bollean value but w.zoomed is a pointer to a pointer 
of a boolean value... I guess...


David Buff


- Original Message - 
From: slangeberg [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 4:32 PM
Subject: Re: [Flashcoders] Boolean question


Correct me if I'm wrong but I believe the Boolean type is still a 
primitive

and should not be instantiated with 'new'.

You could perform casting like this:

w = new Object();
w.zoomed = Boolean( false );

But I don't know what benefit it would give, as Flash doesn't support 
typing

on the parameters of an Object instance.

Scott

On 10/19/06, Mendelsohn, Michael [EMAIL PROTECTED] wrote:


Hi list...

Why does an object's parameter not change if it's instanced as a new
Boolean()?

w = new Object();
w.zoomed = new Boolean(false);
trace (w.zoomed);
//false
w.zoomed = !(w.zoomed);
trace (w.zoomed);
//false

q = new Object();
q.zoomed = false;
trace (q.zoomed);
//false
q.zoomed = !(q.zoomed);
trace (q.zoomed);
//true

Thanks,
- Michael M.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--

: : ) Scott
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
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] Selection.getFocus()

2006-10-19 Thread David Buff

Hi

I did something like this before... You can do a recursive method parsing 
the path like this:


function extractObject(aPath:String):Object {
   return extractObjectRecurs(this, aPath.split(.), 0);
} // end extractRunTime

function 
extractObjectRecurs(aRankObject:Object,aPathArray:Array,aIndex:Number):Object 
{

   if (aIndexaPathArray.length-1) {
   return 
extractObjectRecurs(aRankObject[aPathArray[aIndex]],aPathArray,aIndex+1);

   } else {
   return aRankObject[aPathArray[aIndex]];
   }
} // end extractRecursRunTime


onEnterFrame = function() {
   trace(--- NEW FRAME );
   var path:String = Selection.getFocus();
   trace(PATH: +path);
   var object:Object = extractObject(path);
   trace(TARGET POSITION: +object._x);
}

Put your object inside your object inside your object inside ... and on the 
stage... run the fla and select it.


David Buff
- Original Message - 
From: Lieven Cardoen [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 4:53 PM
Subject: [Flashcoders] Selection.getFocus()


FlashCoders,



Selection.getFocus() gives back a String. Is there a way to get the
Object?



Thx, Lieven Cardoen



Lieven Cardoen
Application developer

indiegroup
interactive digital experience
engelse wandeling 2 k18
b8500 kortrijk



Indie group zal op maandag 23 oktober uitzonderlijk gesloten zijn.

Indie group will be closed on Monday, October 23th.



___
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] Selection.getFocus()

2006-10-19 Thread David Buff

Hi again...

eval works but it's a old fonction... I'm not sure it works good in AS 2.0

David Buff

- Original Message - 
From: Michael Stuhr [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, October 19, 2006 5:08 PM
Subject: Re: [Flashcoders] Selection.getFocus()



Lieven Cardoen schrieb:
FlashCoders, 

 


Selection.getFocus() gives back a String. Is there a way to get the
Object?


eval()

micha
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] doLater not working

2006-10-18 Thread David Buff

I think...

You have to be attentive about the fact that flash execute the code from the 
upper layer to the lower layer. So if your _root.panelBG.sp.doLater(_root, 
displayCorrectFrame); is written on a layer witch is upper layer of the 
one where is created your scrollPlane, this last one doesn't exist when the 
function is called... Try to write tour _root.panelBG.sp.doLater(_root, 
displayCorrectFrame); on the frame 2, if it works, it's because you don't 
do the things in wright order...


David Buff


- Original Message - 
From: Mendelsohn, Michael [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, October 17, 2006 9:56 PM
Subject: [Flashcoders] doLater not working


Hi list...

I have a line of code on frame 1 of the _root:
_root.panelBG.sp.doLater(_root, displayCorrectFrame);
...where sp is a scrollPane component inited in the panelBG mc.

My doLater function is also on frame 1 of the _root, but it never gets
fired.  I can't figure out why.  I think it might be a scope issue, but
it's all only on frame 1 of the _root timeline.

Thanks,
- Michael M.

___
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] Weird image download problems in IE

2006-10-17 Thread David Buff
One way could be to draw a part of  your image into a small BitmapData then 
do a getPixel, if the value is not 0, your image is loaded. I've a problem 
with IE and the flash loader too. But it's with request on cfm pages. After 
200 requests, the connection come back with success, but the values are 
undefined... I work on this since a week without finding a good solution... 
This problem appear only with IE7. It seem's that there is actually a 
problem with IE and Flash. Have you also this problem only with IE7 or with 
all IE releases ??



- Original Message - 
From: Hans Wichman [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Monday, October 16, 2006 11:35 PM
Subject: Re: [Flashcoders] Weird image download problems in IE



Hi,
there is a bug in the loader component, which might be whats bothering you
in your case.
It plagues the scrollpane too, but there is a fix somewhere out there:)

greetz
JC


On 10/16/06, Alain Rousseau [EMAIL PROTECTED] wrote:


I've never used the Loader myself, so I can't really help you out with
this
error, but it might be an issue with Adobe's ActiveX Add-on ?? If it's
only
IE that's affected that's where I would be looking.

Alain

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andy
Herrman
Sent: 16 octobre 2006 16:31
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Weird image download problems in IE

Awesome, looks like that works.  Thanks!

Any idea what's causing the problem with the Loader?  Just some bug in
Flash
or IE?

  -Andy

On 10/16/06, Alain Rousseau [EMAIL PROTECTED] wrote:
  Have you tried using the MovieClipLoader class ?

 It has an event very usefull called onLoadError . It gives you the
 following informations (quote from the livedocs):

 errorCode:String - A string that explains the reason for the failure,
 either URLNotFound or LoadNeverCompleted.

 httpStatus:Number [optional] - (Flash Player 8 only) The HTTP status
 code returned by the server. For example, a status code of 404
 indicates that the server has not found anything that matches the
 requested URI. For more information about HTTP status codes, see
 sections 10.4 and 10.5 of the HTTP specification at
ftp://ftp.isi.edu/in-notes/rfc2616.txt.;



 You should look up the full docs on the matter here :
 http://livedocs.macromedia.com/flash/8/main/2538.html

 HTH !


 Alain

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Andy
 Herrman
 Sent: 16 octobre 2006 15:23
 To: Flashcoders
 Subject: [Flashcoders] Weird image download problems in IE

 We're running into a really strange problem with image downloads in
 Flash when running in IE and was wondering if anyone else has seen
 something like this or has any ideas on what I could do to fix it.

 We need to have the Flash movie be able to download arbitrary images
 from the web and display them.  I also need to be able to tell whether
 the download worked or not, so I can display an error if it failed or
 manipulate the image if it loaded.

 The problem we're running into is that in IE the loader class will
 tell us the image failed to load even though it worked fine.  Here's
 some test code we used to test:

 ---
 import mx.controls.Alert

 this.createClassObject(mx.controls.Loader, my_ldr, 10);

 var poLoaderListener = new Object();
 poLoaderListener.oScope = this;

 poLoaderListener.complete = function(oEvent)
 {mx.controls.Alert.show(oEvent.total); };

 poLoaderListener.progress = function() {};

 my_ldr.addEventListener('complete', poLoaderListener);
 my_ldr.addEventListener('progress', poLoaderListener);

 my_ldr.load(IMAGE_URL);
 ---

 When running this in Firefox it works fine, and the alert box gives us
 the right value.  However, in IE when trying this the alert box pops
 up with a -1, telling us the download failed.  However, the image still
shows up.

 The only thing I've been able to figure out is that the speed of the
 download has something to do with it.  In the actual product we're
 downloading the images through a server that acts as a sort of proxy
 which caches the images.  The first time we hit it the proxy has to
 download the source image before returning it to the client.  This is
 when we see the problem.  Later attempts seem to work fine as the
 download happens faster (the server cached the image so it doesn't have
to
redownload it).

 To simplify the test I took the proxy out of the loop and threw a
 bandwidth limiter on the server that had the image I was testing.
 When throttling it back to act like a 56k modem I could reproduce the
 error in IE.  It still worked fine (just really slow) in Firefox.

 Has anyone seen this before?  It's causing serious problems, as we
 need to be able to tell if the image downloaded successfully or not.
 Any ideas of ways to get around this or fix it?  Note that we have to
 support Flash 7+.

 Thanks!

-Andy
 

[Flashcoders] Problem with response of cfm pages especially with IE 7.0

2006-10-17 Thread David Buff
Hi FlashCoders !
Sorry again for my bad english...

We've a big and curious problem with cfm pages, since one week, without finding 
a real solution.
It seem's there is a problem beetween flash player and navigator especialy IE 
7.0

We build online games, and this games make request to the server using cfm 
pages (ColdFusion 5.0 and Flash 8 pro).
For exemple, the Flash ask to the map description off a game, like:

http://www.domaine.com/game/general.cfm?action=ask_map
and the cfm page return:
id_map=152map_description=5,6,9,1,2,3,8,4,5,6,1,5,3 etc...

With IE 7, after 200 or 220 requests to the cfm page, the connection return 
with success but the params are undefined. We need to clear the cache of IE 
to be abble again to get params from the cfm page, and this only for 200 
requests again.
We've verifyed with the plugin HttpWatch that the connection was success, and 
that the params was correctly returned by the cfm page. So the navigator get 
the params, but did'nt pass theym to the flash player.

We've try to add a timer (date+time, it's a unique number, better than a random 
number) to the URL like:
http://www.domaine.com/game/general.cfm?timer=121546546685211action=ask_map 
... doesn't change anything

We've try to add the timer befor the ? of the URL with a \ (not /) we 
send something like:
http://www.domaine.com/game/general.cfm\timer=121546546685211?action=ask_map
(The navigator automaticaly correct \ in /, I don't know if this is important 
to explain)
With this solution, we did'nt have any problem with IE 7, but it start to be 
worst with FireFox especially release 1.5.0.7

I test today with a cookie on one game, around 1500 gamers (about 100 requests 
by gamer), there was 4% of theym who has a connection witch comes back with no 
success and 1.3% witch comes back with success but where the params are 
undefined. When connection work wrong, the game test automaticaly again the 
connection a second time. Only 0.4% of the gamers ware not abble to get a good 
connection again. But it seem's hudred by day...

Does anybody have a similar problem? any solution?

The flash code is something like this:

var varLoader:LoadVars = new LoadVars();
function askMap() {
 varLoader.onLoad = _root.askMap_callBack;
 
varLoader.sendAndLoad(http://www.domaine.com/game/general.cfm?action=ask_map,varLoader,GET;);
}
function askMap_callBack(success) {
 if (success != true){
  trace(no success);
  // do something in the game
 }else{
  trace(success);
  for (var i_o in varLoader) {
   trace(param:+i_o+ -- +varLoader[i_o]);
  }
  // do something in the game
 }
}

it returns (trace):
success
param:id_map -- 152
param:map_description -- 5,6,9,1,2,3,8,4,5,6,1,5,3 etc...
___
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] Problem with repsonse of cfm pages especially with IE

2006-10-17 Thread David Buff

Hi FlashCoders !
Sorry again for my bad english...

We've a big and curious problem with cfm pages, since one week, without 
finding a real solution.
It seem's there is a problem beetween flash player and navigator especialy 
IE 7.0


We build online games, and this games make request to the server using cfm 
pages (ColdFusion 5.0 and Flash 8 pro).

For exemple, the Flash ask to the map description off a game, like:

http://www.domaine.com/game/general.cfm?action=ask_map
and the cfm page return:
id_map=152map_description=5,6,9,1,2,3,8,4,5,6,1,5,3 etc...

With IE 7, after 200 or 220 requests to the cfm page, the connection return 
with success but the params are undefined. We need to clear the cache of 
IE to be abble again to get params from the cfm page, and this only for 200 
requests again.
We've verifyed with the plugin HttpWatch that the connection was success, 
and that the params was correctly returned by the cfm page. So the navigator 
get the params, but did'nt pass theym to the flash player.


We've try to add a timer (date+time, it's a unique number, better than a 
random number) to the URL like:
http://www.domaine.com/game/general.cfm?timer=121546546685211action=ask_map 
... doesn't change anything


We've try to add the timer befor the ? of the URL with a \ (not /) we 
send something like:

http://www.domaine.com/game/general.cfm\timer=121546546685211?action=ask_map
(The navigator automaticaly correct \ in /, I don't know if this is 
important to explain)
With this solution, we did'nt have any problem with IE 7, but it start to be 
worst with FireFox especially release 1.5.0.7


I test today with a cookie on one game, around 1500 gamers (about 100 
requests by gamer), there was 4% of theym who has a connection witch comes 
back with no success (both navigators) and 1.3% witch comes back with 
success but where the params are undefined (usually IE). When connection 
work wrong, the game test automaticaly again the connection a second time. 
Only 0.4% of the gamers ware not abble to get a good connection again. But 
it seem's hudred by day...


Does anybody have a similar problem? any solution?

The flash code is something like this:

var varLoader:LoadVars = new LoadVars();
function askMap() {
varLoader.onLoad = _root.askMap_callBack;
varLoader.sendAndLoad(http://www.domaine.com/game/general.cfm?action=ask_map,varLoader,GET;);}function 
askMap_callBack(success) { if (success != true){  trace(no success);  // do something in the game }else{  trace(success);  
for (var i_o in varLoader) {   trace(param:+i_o+ -- +varLoader[i_o]);  }  // do something in the game }}it returns 
(trace):successparam:id_map -- 152param:map_description -- 5,6,9,1,2,3,8,4,5,6,1,5,3 etc...
___
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] how to identify the navigator?

2006-10-11 Thread David Buff
I need to know witch navigator is running the swf... and it will be better if I 
can do that in flash, without using javascript. I didn't find a solution in the 
reference pages, does somebody know how to do??
___
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] CacheAsBitmap advice

2006-10-11 Thread David Buff


With BitmapData, you can build a BitmapData of your picture, for exemple 
1000x600 witch will stay in memory, and will not be displayed. After that, 
you create another BitmapData witch is only 500x300 for exemple, the size 
you need for display. Then you draw the first BitmapData in the second with 
the draw() method, according to a geom.matrix witch describe the translation 
you need for scroll, and also the zoom. Doing this, your scroll and zoom 
will be faster.


Remember that the cacheAsBitmap property is true by default. May be there 
isn't difference in you're test because you didn't try to define 
cacheAsBitmap as false (and only compare default and true, witch is the same 
thing).


I went to your site. It seem's that when we zoom in a picture, this picture 
is first reduced like 20% and when you zoom, you increase to 100% with a 
mask. Am'I wrong? In this case, and also for the scroll, you will not realy 
increase the speed with cacheAsBitmap. But I think you can do much better 
using BitmapData, scroll(), draw() and flash.geom.matrix in the draw() 
method.


always sorry for my english

David Buff

- Original Message - 
From: Jason Ross [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Wednesday, October 11, 2006 1:36 PM
Subject: RE: [Flashcoders] CacheAsBitmap advice


Hi - thank you to both Ian and Ramon.

And yes, the pictures are scrolling, but they are contained in
movieclips that contain vector data (i.e. to artwork around the photos).
See what I mean? Though I take your point as through my experimentation
I get the same results whether CacheAsBitmap is turned on or not.

Great idea to unload / reload as they come on / off the screen! Will do
that one right away.

Thank again.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ramon
Miguel M. Tayag
Sent: 11 October 2006 12:21
To: Flashcoders mailing list
Subject: Re: [Flashcoders] CacheAsBitmap advice

If you're scrolling pictures, you don't really need to cache as
bitmap.  It would be best to use it when there's a lot of vector data
that bogs the system down when animating.

One thing you could do to optimize things is whent he pictures go
offscreen, unload them.

On 10/11/06, Jason Ross [EMAIL PROTECTED] wrote:

Hi,

I have a photo sharing site that was coded in Flash 6.0 using AS 1.0

of

course. I am in the process of updating all code to AS 2.0 and was
hoping to use CacheAsBitmap to improve the performance. This link
demonstrates a folder on the site with many images:

http://www.fotoko.com/?str=1N%3D%2A%5C%3BKLP6R%3DT3%5BB%2E1R%0Ast%15

Ideally, I would like to speed up things like (which, on a slow PC

these

things can run pretty poorly):

* Scrolling (using the slider on the bottom of the screen)
* Image inflates (when you click an image)
* Animations (when you click 'NEXT / PREVIOUS')

I know that CacheAsBitmap should be used carefully, which is what I am
struggling on. The site is coded quite well with many nested movie
clips. This is where I struggle to understand where / if I should

apply

a CacheAsBitmap command.

Stage
|
-- ScrollerMC
|
-- Thumbnail
|  |
|  -- ImageLoaderMC
|   |
|   -- thumbImageLoaderMC
|   -- mainImageLoaderMC
|
-- Thumbnail
   |
   -- ImageLoaderMC
|
-- thumbImageLoaderMC
-- mainImageLoaderMC

Any help would be greatly appreciated.

Jason.

Legal Disclaimer:
This email message (including any attachments) is strictly

confidential and is intended only for the person(s) or organisation(s)
named above.  The unauthorised use, disclosure, distribution and/or
copying of the email message, or any information it contains (including
any attachments), is strictly prohibited and could in certain
circumstances constitute a legal offence.  If you are not an intended
recipient, please contact the sender immediately by return email and
delete the email from your system.


Internet email communications are not always secure and may be

susceptible to data corruption, interception and unauthorised amendment,
and therefore View does not accept legal responsibility for the
contents of this message for any such corruption, interception or
amendment or the consequences thereof nor any delay in its receipt.


Although this email message and any attachments are believed to be

free of any virus or other defect that might affect any computer system
into which it is received and opened, it is the responsibility of the
recipient to ensure that it is virus free.  No responsibility is
accepted by View for any loss or damage in any way arising from its
use.


Any views expressed by the sender of this message are not necessarily

those of View.

_
This message from View

Re: [Flashcoders] IE doesn't seem to want to recognize FlashVars

2006-10-11 Thread David Buff
I've got a similar problem with the cache of IE7.0, try to clean your cache, 
and try your swf again. If it resolve the problem, tell me, I'm working on a 
solution...


- Original Message - 
From: Christopher Whiteford [EMAIL PROTECTED]

To: Flashcoders@chattyfig.figleaf.com
Sent: Wednesday, October 11, 2006 4:33 PM
Subject: [Flashcoders] IE doesn't seem to want to recognize FlashVars


Ok I have a page that redirects based on FlashVars and for some reason 
every
browser expect IE seems to work. I have tried using flashobject, passing 
the
variables in the querystring and referencing _root variable. I am at my 
wits

end with this.

If anyone could take a look at it in IE and Firefox and possibly have some
explanation I would be thankful.

Here is the link:
http://www.iconicweb.com/indextest.html?page=PortfoliosubPage=toyotaEPNS
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Playing video backwards kills my CPU

2006-10-10 Thread David Buff

sorry for my bad english...

There is two kinds of movie codec for the compression, first using spacial 
compression only (like mjpeg...), and second using spatial compression  in 
association with key frame (like mpeg, sorenson...). The key frame describe 
the entire picture only once each 15 frames or 8 frames for exemple. The 
other frames describe only what has changed in the picture, with a 
threshold. It describe for exemple only the arm of a people who's moving, 
but not the background witch do not move.


So when you want to read a movie forward, the codec read the key frame witch 
is the reference to fill the holes not described in the other frames. Each 
15 frames, a new key frame describe the entire picture (so also the 
background) and define a new reference for the next frames.


The problem is that when you want to play backward, like frame-1, the CPU 
need to go 15 frames before to find the previous key frame, load the entire 
description of the picture, and build frame by frame, fill the different 
holes of each frames, to be able to display the frame you want.


If you are lucky, your index (frame-1) is the index of a key frame. Then the 
CPU work quickly. But if you are not lucky, your index is (key frame - 14), 
then the CPU need to rebuild 14 frames to be able to display the one you 
want.


There is no solution to your problem, because Flash don't offer the 
possibility to use a only spatial codec compression. And this kind of 
compression take a lot of Mo because all frames are described.


I thaught to an alternative but never tried it, you can try to draw each 
frame of your movie in so many BitmapData you need. It will take a lot of 
memory space, and a preload time, but after that, you index the BitmapData 
you need, and it will work faster. I don't know if it is possible to draw a 
.mov frame in a BitmapData. If it's possible, tell us.


David Buff

- Original Message - 
From: Ricardo Sánchez [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, October 10, 2006 10:07 AM
Subject: [Flashcoders] Playing video backwards kills my CPU



I have a .mov embebbed in the timeline as a movieclip. I have setted a stop
to it so I play it with a codeline like this video.gotoAndStop
(video._currentframe+1);

It works perfectly, my problem comes when I want to play it backwards, I
follow a similar procedure doing: 
video.gotoAndStop(video._currentframe-1);


It seems to work but it kills my CPU making everyother thing in the site 
not

working and making the video running slowlier. When I go back to fordward
playing everything goes back to normality.

Any clues? Do I have to look for some flaws in my code or is there 
something

wrong with embbebed video?

Thanks
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Playing video backwards kills my CPU

2006-10-10 Thread David Buff

sorry for my bad english...

There is two kinds of movie codec for the compression, first using spacial 
compression only (like mjpeg...), and second using spatial compression  in 
association with key frame (like mpeg, sorenson...). The key frame describe 
the entire picture only once each 15 frames or 8 frames for exemple. The 
other frames describe only what has changed in the picture, with a 
threshold. It describe for exemple only the arm of a people who's moving, 
but not the background witch do not move.


So when you want to read a movie forward, the codec read the key frame witch 
is the reference to fill the holes not described in the other frames. Each 
15 frames, a new key frame describe the entire picture (so also the 
background) and define a new reference for the next frames.


The problem is that when you want to play backward, like frame-1, the CPU 
need to go 15 frames before to find the previous key frame, load the entire 
description of the picture, and build frame by frame, fill the different 
holes of each frames, to be able to display the frame you want.


If you are lucky, your index (frame-1) is the index of a key frame. Then the 
CPU work quickly. But if you are not lucky, your index is (key frame - 14), 
then the CPU need to rebuild 14 frames to be able to display the one you 
want.


There is no solution to your problem, because Flash don't offer the 
possibility to use a only spatial codec compression. And this kind of 
compression take a lot of Mo because all frames are described.


I thaught to an alternative but never tried it, you can try to draw each 
frame of your movie in so many BitmapData you need. It will take a lot of 
memory space, and a preload time, but after that, you index the BitmapData 
you need, and it will work faster. I don't know if it is possible to draw a 
.mov frame in a BitmapData. If it's possible, tell us.


David Buff

- Original Message - 
From: Ricardo Sánchez [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, October 10, 2006 10:07 AM
Subject: [Flashcoders] Playing video backwards kills my CPU



I have a .mov embebbed in the timeline as a movieclip. I have setted a stop
to it so I play it with a codeline like this video.gotoAndStop
(video._currentframe+1);

It works perfectly, my problem comes when I want to play it backwards, I
follow a similar procedure doing: 
video.gotoAndStop(video._currentframe-1);


It seems to work but it kills my CPU making everyother thing in the site 
not

working and making the video running slowlier. When I go back to fordward
playing everything goes back to normality.

Any clues? Do I have to look for some flaws in my code or is there 
something

wrong with embbebed video?

Thanks
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Playing video backwards kills my CPU

2006-10-10 Thread David Buff

Hello again

Another way:
When you import your video, when you are on the Encoding page, select 
Show Advanced Settings, then Key frame placement to custom, and write 
1 in Key frame Interval. So each frame will be a key frame, and each 
frame will be all described. But your swf will be more eavy. I have no time 
to try it, may be it works...


David Buff

- Original Message - 
From: David Buff [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, October 10, 2006 10:48 AM
Subject: Re: [Flashcoders] Playing video backwards kills my CPU


sorry for my bad english...

There is two kinds of movie codec for the compression, first using spacial
compression only (like mjpeg...), and second using spatial compression  in
association with key frame (like mpeg, sorenson...). The key frame describe
the entire picture only once each 15 frames or 8 frames for exemple. The
other frames describe only what has changed in the picture, with a
threshold. It describe for exemple only the arm of a people who's moving,
but not the background witch do not move.

So when you want to read a movie forward, the codec read the key frame witch
is the reference to fill the holes not described in the other frames. Each
15 frames, a new key frame describe the entire picture (so also the
background) and define a new reference for the next frames.

The problem is that when you want to play backward, like frame-1, the CPU
need to go 15 frames before to find the previous key frame, load the entire
description of the picture, and build frame by frame, fill the different
holes of each frames, to be able to display the frame you want.

If you are lucky, your index (frame-1) is the index of a key frame. Then the
CPU work quickly. But if you are not lucky, your index is (key frame - 14),
then the CPU need to rebuild 14 frames to be able to display the one you
want.

There is no solution to your problem, because Flash don't offer the
possibility to use a only spatial codec compression. And this kind of
compression take a lot of Mo because all frames are described.

I thaught to an alternative but never tried it, you can try to draw each
frame of your movie in so many BitmapData you need. It will take a lot of
memory space, and a preload time, but after that, you index the BitmapData
you need, and it will work faster. I don't know if it is possible to draw a
.mov frame in a BitmapData. If it's possible, tell us.

David Buff

- Original Message - 
From: Ricardo Sánchez [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Tuesday, October 10, 2006 10:07 AM
Subject: [Flashcoders] Playing video backwards kills my CPU



I have a .mov embebbed in the timeline as a movieclip. I have setted a stop
to it so I play it with a codeline like this video.gotoAndStop
(video._currentframe+1);

It works perfectly, my problem comes when I want to play it backwards, I
follow a similar procedure doing: 
video.gotoAndStop(video._currentframe-1);


It seems to work but it kills my CPU making everyother thing in the site 
not

working and making the video running slowlier. When I go back to fordward
playing everything goes back to normality.

Any clues? Do I have to look for some flaws in my code or is there 
something

wrong with embbebed video?

Thanks
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@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: Re: [Flashcoders] Playing video backwards kills my CPU

2006-10-10 Thread David Buff
Yes, i'm not sure to understand this post, but the way is to build 2 movies, 
one running in the original direction, and another running back. So when you 
want to read forward, you index the frame of the first movie, when you want 
to read backward, you swap your movie, and index the frame of the second 
movie (witch is running back).


Good idea

David Buff




- Original Message - 
From: Toby [EMAIL PROTECTED]

To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
Sent: Tuesday, October 10, 2006 5:17 PM
Subject: RE: Re: [Flashcoders] Playing video backwards kills my CPU



If you want to play video backwards don't be silly and try and rewind your
actual movie (for the reasons already outlining in the email responses 
compression and keyframes)

You will need to do this in a video editing program, then export a 
separate

video. This solution is feasible if your .mov displays a 3D model and you
want to reverse an animation maybe...

You need to look at your brief, asses why you are trying to rewind the
video, and then look for the best technology to do this. Telling flash to 
go
through your compressed movie backwards frame by frame is lunacy (as you 
are

finding out the hard way).

Sort it out, or your clients expectations (or even your own!).
T


-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of nelson ramirez
Sent: 10 October 2006 15:45
To: Flashcoders mailing list
Subject: Re: Re: [Flashcoders] Playing video backwards kills my CPU

Have you tried flv. don't know why but flvs always work much smoother for
me.

On 10/10/06, Zeh Fernando [EMAIL PROTECTED] wrote:
  It seems to work but it kills my CPU making everyother thing in the
site
  not
  working and making the video running slowlier. When I go back to
fordward
  playing everything goes back to normality.
  Any clues? Do I have to look for some flaws in my code or is there
  something
  wrong with embbebed video?

 It's probably neither one of those alternatives - it's more like a fact
of
 life.

 The way temporal compression works for video is by having one keyframe
(the
 entire image) followed by several frames (chunks of image that only
specify
 changes to the image data). When doing forward this is fine, but when
 seeking to a different frame, the render has to actually go to an
specific
 keyframe, then render forward to the specified frame. Because of this,
going
 backwards really *is* much more difficult to any player or codec 
 (unless

you
 have one keyframe every frame, which defeats the purpose of temporal
 compression).

 If you're having that problem, try lowering the steps between keyframes
on
 your video (say, one keyframe every 15 frames instead of one every 30
 frames). It should make things better, but at a cost - your video file
will
 be bigger.


 Zeh

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



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