[Flashcoders] BitMapData problem - remains on stage

2010-06-25 Thread Tony Fairfield
I'm working in CS4, actionscript 3, player 10, and having an issue with
a BitmapData screen grab I've written. 

The code captures a bitmap of the stage area (not an instance or clip),
adds to a movie clip and then fades that out over a second. When done,
it disposes of the BitmapData using .dispose(), and the containing
clip's visiblitity set to false.

 

The problem is that something is still there, as buttons that were on
the stage are not clickable afterwords - they are blocked.

 

Perhaps I'm missing something obvious, but I can't figure it out. Could
the problem be that I am creating a bitmap of stage and not a movie
clip instance? Or a known issue with BitmapData?

 

Here is the code of the full routine. If anyone spots the problem thanks
very much in advance. 

 

//declare all variables and instances outside of functions:

var timeline;

var tween_OS:Tween;

var bitmapData_OS:BitmapData;

var rect:Rectangle;

var oldscreen:MovieClip;

var fadeoutclip:MovieClip;

var bmp_OS:Bitmap;

var geometry:Array;

var transparent:Boolean;

var backgroundcolor:uint;

var fullXfade:Boolean;

var tr:uint;

 

//the initializing function is called first, giving the target as stage,
the rectangle dimensions etc:

//eg : FrameXFade(stage,[0, 100, 980, 398.2],[0,0],true,0xFF,false);

function FrameXFade(mc,geom,xy,trans,fillCol,crossfade) {

timeline=mc;

geometry=geom;

transparent = (trans==null) ? true : trans;

backgroundcolor = (fillCol==null) ? 0xFF : fillCol;

fullXfade = (crossfade==null) ? false : crossfade;

rect=new Rectangle(geom[0],geom[1],geom[2],geom[3]);

oldscreen = new MovieClip();

oldscreen.x=xy[0];

oldscreen.y=xy[1];

fadeoutclip = timeline.addChild(oldscreen);

}

//then the fade function can be called:

function Xfade() {

if (bitmapData_OS) {

bitmapData_OS.dispose();

}

bitmapData_OS=new
BitmapData(geometry[2]+geometry[0],geometry[3]+geometry[1],transparent,b
ackgroundcolor);

bitmapData_OS.draw(timeline, null,null,null,rect);

bmp_OS=new Bitmap(bitmapData_OS);

fadeoutclip.visible=true;

if (fadeoutclip.numChildren1) {

fadeoutclip.removeChildAt(1);

}

fadeoutclip.addChild(bmp_OS);

tween_OS=new
Tween(fadeoutclip,alpha,Strong.easeOut,1,0,1,true);

 
tween_OS.addEventListener(TweenEvent.MOTION_FINISH,XfadeOSDone);

}

function XfadeOSDone(e:Event) {

 
tween_OS.removeEventListener(TweenEvent.MOTION_FINISH,XfadeOSDone);

if (bitmapData_OS) {

bitmapData_OS.dispose();

//some additional attempts at clearing it when dispose didn't seem to
work

fadeoutclip.removeChild(bmp_OS);

System.gc();

}

fadeoutclip.visible=false;

}

 

 

Tony Fairfield
Programmer
Lifelearn, Inc.

67 Watson Road S, Unit 5
Guelph, ON  N1L 1E3
www.lifelearn.com http://www.lifelearn.com 

T: 519-767-5043
F: 519-767-1101

 

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


RE: [Flashcoders] display list overrides keyframes

2010-06-25 Thread Tony Fairfield
Thanks Juan - after many other attempts this is the approach I ended up
with.



Tony Fairfield
Programmer
Lifelearn, Inc.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Juan
Pablo Califano
Sent: June 21, 2010 8:25 PM
To: Flash Coders List
Subject: Re: [Flashcoders] display list overrides keyframes

A possible workaround could be adding a reset method that (re)initalizes
the
behaviour. You could move your constructor logic to this method. So,
your
constructor calls reset() when the object is first instantiated. Then,
when
neccesary, you could call this method to reset the behaviours (in a
frame
script in the timeline or where your code issues the gotoAndStop or
gotoAndPlay that changes the frame).

Hope this helps.

Cheers
Juan Pablo Califano


2010/6/21 Tony Fairfield tfairfi...@lifelearn.com

 Is there a way to overcome the following:



 I have a timeline file, with quiz buttons on each frame. Each button
is
 a duplicate of one basic movie clip with a linked class and a
 constructor that initializes the behaviour -- rollovers etc. For each
 frame, the buttons are named a1, a2, a3 etc. The problem is, I
 foolishly assumed that a new keyframe meant these would be considered
 all brand new buttons by Flash, and their constructor functions would
 dutifully fire afresh, and all would be well. Of course, they don't:
as
 far as the Display List is concerned, if there was a button called
a1
 in frame 1, and if there's a button with the same name in frame 2,
they
 are exactly the same button, to hell with the keyframe. Hence, no
 buttons after frame 1 will fire their constructor function. Even the
 state of the previous button -- if it had been selected - is applied
to
 the new button with the same name.



 Normally, I would have built something like this dynamically, adding
and
 removing the buttons, but I was given an exisitng file that was
quicker
 (I thought) to work with as is, than to rework into a single frame,
 dynamic file. I'm probably just going about things the wrong way. I
hope
 this is a fairly garden variety issue with a solution (other than
 abandoning the timeline approach).



 Thanks for any input.



 Tony Fairfield
 Programmer
 Lifelearn, Inc.

 67 Watson Road S, Unit 5
 Guelph, ON  N1L 1E3
 www.lifelearn.com http://www.lifelearn.com

 T: 519-767-5043
 F: 519-767-1101



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

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

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


RE: [Flashcoders] HTMLLoader and AIR -- always a nice white blank

2010-06-21 Thread Tony Fairfield
Yes, as

pdf.height = stage.stageHeight;
pdf.width = stage.stageWidth; 

I found one glaringly stupid mistake I'd made: not including the local
documents I was loading with the AIR build. When I simply tested the
movie, it finally showed. Still can't get a site URL (such as adobe home
page) to work, but I'm working on that one now...

Thanks for your reply,


Tony Fairfield
Programmer
Lifelearn, Inc.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven
Sacks
Sent: June 20, 2010 5:39 PM
To: Flash Coders List
Subject: Re: [Flashcoders] HTMLLoader and AIR -- always a nice white
blank

Did you trace the width and height?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


RE: [Flashcoders] HTMLLoader and AIR -- always a nice white blank

2010-06-21 Thread Tony Fairfield
Thanks, that sounds worth focussing on. I'll try that out. I've got the
COMPLETE so far but I'll investigate what else I can trace.

T

Tony Fairfield
Programmer
Lifelearn, Inc.

67 Watson Road S, Unit 5
Guelph, ON  N1L 1E3
www.lifelearn.com

T: 519-767-5043
F: 519-767-1101


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Andrew
Murphy
Sent: June 21, 2010 10:50 AM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] HTMLLoader and AIR -- always a nice white
blank

If you haven't tried this yet:  Add event listeners and traces to all of
the
relevant events that the HTML component throws, and see if that can give
you
more details on what it's doing.. or not doing.


 --
Andrew Murphy
Interactive Media Developer
amur...@delvinia.com

Delvinia
370 King Street West, 5th Floor, Box 4 
Toronto Canada M5V 1J9
P (416) 364-1455 ext. 232
F (416) 364-9830  
W www.delvinia.com

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Tony
Fairfield
Sent: June 21, 2010 09:08 am
To: Flash Coders List
Subject: RE: [Flashcoders] HTMLLoader and AIR -- always a nice white
blank

Yes, as

pdf.height = stage.stageHeight;
pdf.width = stage.stageWidth; 

I found one glaringly stupid mistake I'd made: not including the local
documents I was loading with the AIR build. When I simply tested the
movie, it finally showed. Still can't get a site URL (such as adobe home
page) to work, but I'm working on that one now...

Thanks for your reply,


Tony Fairfield
Programmer
Lifelearn, Inc.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven
Sacks
Sent: June 20, 2010 5:39 PM
To: Flash Coders List
Subject: Re: [Flashcoders] HTMLLoader and AIR -- always a nice white
blank

Did you trace the width and height?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


[Flashcoders] display list overrides keyframes

2010-06-21 Thread Tony Fairfield
Is there a way to overcome the following:

 

I have a timeline file, with quiz buttons on each frame. Each button is
a duplicate of one basic movie clip with a linked class and a
constructor that initializes the behaviour -- rollovers etc. For each
frame, the buttons are named a1, a2, a3 etc. The problem is, I
foolishly assumed that a new keyframe meant these would be considered
all brand new buttons by Flash, and their constructor functions would
dutifully fire afresh, and all would be well. Of course, they don't: as
far as the Display List is concerned, if there was a button called a1
in frame 1, and if there's a button with the same name in frame 2, they
are exactly the same button, to hell with the keyframe. Hence, no
buttons after frame 1 will fire their constructor function. Even the
state of the previous button -- if it had been selected - is applied to
the new button with the same name. 

 

Normally, I would have built something like this dynamically, adding and
removing the buttons, but I was given an exisitng file that was quicker
(I thought) to work with as is, than to rework into a single frame,
dynamic file. I'm probably just going about things the wrong way. I hope
this is a fairly garden variety issue with a solution (other than
abandoning the timeline approach).

 

Thanks for any input.

 

Tony Fairfield
Programmer
Lifelearn, Inc.

67 Watson Road S, Unit 5
Guelph, ON  N1L 1E3
www.lifelearn.com http://www.lifelearn.com 

T: 519-767-5043
F: 519-767-1101

 

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


[Flashcoders] HTMLLoader and AIR -- always a nice white blank

2010-06-20 Thread Tony Fairfield
Are there known issues with the HTMLLoader method?

 

No success at all with it: I have CS4, and building with AIR 1.5, and
can only get one result: a white box when the content loads (whether
html or pdf). I have tried many options: local documents, site urls (as
in Adobe's eg below), PDF, straight html, and PDF embedded into html.
Tried it at work and at home to eliminate possibility of some obscure
security setting.

 

Here's Adob'es own example from Live docs, which I've implemented
exactly (without success):

 

public function HTMLLoaderExample()

{

var html:HTMLLoader = new HTMLLoader();

var urlReq:URLRequest = new
URLRequest(http://www.adobe.com/;);

html.width = stage.stageWidth;

html.height = stage.stageHeight;

html.load(urlReq); 

addChild(html);

}

 

I've seen many posts about transaprency, but that isn't the issue (my
app.xml has transparency set to false).

 

Some mention adding the content to a UIComponent once the document is
loaded. Tried that.

 

I'm stumped by this, as I see exactly the same script for this process
everywhere, including the AIR 1.5 Cookbook. I'm beginning to think it's
a fiction.

 

Any advice or tips much appreciated.

 

Tony Fairfield
Programmer

Lifelearn Inc.



 

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


[Flashcoders] AIR configuration file

2010-01-08 Thread Tony Fairfield
Does anyone have experience with custom application descriptor files and
AIR? I'm using Flash CS4 to create an AIR application, and am unable to
use a custom application descriptor file with it when I generate the
program. I have based mine on the Adobe sample, and used the online
Adobe tutorial - which makes it all seem very simple as is the way of
all tutorials - to confgure it, but I keep getting errors (syntax usage
errors with no indication as to what they might be, can't find an icon
and indicating it is missing from a folder I have not identified as the
icon folder) even when I use the simplest application descriptor file
straight from the Adobe tutorial. I've even got the damn O'reilly AIR
1.5 Cookbook which is equally useless. There seems to be virtually
nothing out there describing some of the errors I've had, and I can't
begin to enumerate them. But here's one as an example: my xml node for
the icons is straight from the sample and is

 

icon 

image16x16icons\AIRApp_16.png/image16x16 

image32x32icons\AIRApp_32.png/image32x32 

image48x48icons\AIRApp_48.png/image48x48 

image128x128icons\AIRApp_128.png/image128x128  

/icon

 

However, an error is thrown telling me that it could not find the icon
in a folder called AppIconsForAIRPublish, not icons. I even tried
creating a folder with this name and copied the icons into it, but found
that it was automatically deleted upon publishing and the same error
thrown.

 

I wouldn't bother with any of this customization but for the fact that
my application needs to be full screen (it's a kiosk program) and AIRs
idea of full screen still shows the chrome. Flash, of course, eliminates
the bar at top with the min,max and restore buttons so that the
interface is clean when full screen. No idea why AIR does it
differently.

 

If anyone could even simply point me to some half-decent documention out
there for AIR using Flash, it would be greatly appreciated.

 

Tony

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


RE: [Flashcoders] AIR configuration file

2010-01-08 Thread Tony Fairfield
Thanks Glen, maybe that will do the trick. I've got the
this.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE line
in there because there are inputs and other interactions needed. But I
might just try the plain FULL_SCREEN and see what happens.

Tony 

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: January 8, 2010 10:38 AM
To: Flash Coders List
Subject: Re: [Flashcoders] AIR configuration file

I have always used this in my kiosk apps - whether they run in AIR or 
from a SWF they seem to behave.

if (false == _env.isBrowser()) {
fscommand(fullscreen, true);
this.stage.displayState = StageDisplayState.FULL_SCREEN;
}

It seems to work okay because it't not in the browser and not restricted

by the have to press a button rule.

Tony Fairfield wrote:
 Does anyone have experience with custom application descriptor files
and
 AIR? I'm using Flash CS4 to create an AIR application, and am unable
to
 use a custom application descriptor file with it when I generate the
 program. I have based mine on the Adobe sample, and used the online
 Adobe tutorial - which makes it all seem very simple as is the way of
 all tutorials - to confgure it, but I keep getting errors (syntax
usage
 errors with no indication as to what they might be, can't find an icon
 and indicating it is missing from a folder I have not identified as
the
 icon folder) even when I use the simplest application descriptor file
 straight from the Adobe tutorial. I've even got the damn O'reilly AIR
 1.5 Cookbook which is equally useless. There seems to be virtually
 nothing out there describing some of the errors I've had, and I can't
 begin to enumerate them. But here's one as an example: my xml node for
 the icons is straight from the sample and is

  

 icon 

 image16x16icons\AIRApp_16.png/image16x16 

 image32x32icons\AIRApp_32.png/image32x32 

 image48x48icons\AIRApp_48.png/image48x48 

 image128x128icons\AIRApp_128.png/image128x128  

 /icon

  

 However, an error is thrown telling me that it could not find the icon
 in a folder called AppIconsForAIRPublish, not icons. I even tried
 creating a folder with this name and copied the icons into it, but
found
 that it was automatically deleted upon publishing and the same error
 thrown.

  

 I wouldn't bother with any of this customization but for the fact that
 my application needs to be full screen (it's a kiosk program) and AIRs
 idea of full screen still shows the chrome. Flash, of course,
eliminates
 the bar at top with the min,max and restore buttons so that the
 interface is clean when full screen. No idea why AIR does it
 differently.

  

 If anyone could even simply point me to some half-decent documention
out
 there for AIR using Flash, it would be greatly appreciated.

  

 Tony

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


   

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

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


[Flashcoders] onLoadInit failure

2006-08-24 Thread Tony Fairfield
Thanks for the feedback Mike. I was vainly hoping it wasn't due to the crap
factor. I will add movieClipLoader to the list of Flash components that
can't quite deliver .

___
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] onLoadInit failure

2006-08-23 Thread Tony Fairfield
Does anyone have any insights as to why onLoadInit (the movieClipLoader
event) might fail in some instances?

Background:
I create programs for CD and web delivery. Programs simply consist of a menu
system and a movie clip into which external swfs are loaded as the content.
I preload this swf content using the movieLoader routine as described in
Flash Help in order for page display to be seamless. I use onLoadInit in
order to gather information about files for use in navigation once they are
initialized and I also have the option to call a function to start the
content.

Problem:
While testing, each swf loaded successfully triggers the onLoadComplete and
then onLoadInit perfectly. However, when launching the projector or the
generated swf, onLoadComplete is always successful but the onLoadInit event
simply fails for the majority of the pages. For reasons I cannot understand,
it will succeed for certain files - the same ones - only occasionally. I
have noticed that page content seems to affect the onLoadInit, because pages
with graphics were less likely to init. And as a test, I created substitute
pages that were completely empty, about 2k each. The problem went away.

Thanks to anyone who can help, even if only to inform me that onLoadInit is
known to be unreliable.

Tony Fairfield

___
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] loadComplete but no loadInit

2006-07-27 Thread Tony Fairfield
Exactly the problem I encountered a few days ago - but no solution to it
yet. The only clue I have is that in the testing environment both
onLoadComplete and onLoadInit were successfully working. It was when I tried
launching either a standalone projector or the swf independently, that the
onLoadInit became erratic - it would fail on certain pages and not on
others. I am loading external swfs as page content using movieClipLoader,
and I know it isn't the page content or size, because all are identical (
small files of about 15k with exactly the same content). I have tried using
delegates and cleaning the Listener and Loader (removing and deleting, then
recreating) up completely after each load - same result. The answer is out
there somewhere .

 

T Fairfield

___
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] onLoadInit works when testing movie, but inconsistent in Projector

2006-07-25 Thread Tony Fairfield

Is anyone familiar with this -- I see several posts but none with this
specific twist:

I am loading all content as swf files into a content clip in my program,
using the movieClipLoader event onLoadInit to show the page once ready for
displaying.

This works perfectly when testing the movie in the authoring environment.
But when I launch the projector (or a generated swf of the program)
directly, the onLoadInit event does not fire consistently. For certain pages
- always the same ones - the last event to fire is onLoadComplete.

Since the pages are identical (they are placeholder pages at the moment)
I've eliminated differences between the files.

Thanks for any advice --

Tony F.


___
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