Re: [flexcoders] Best practices for full screen video in AIR? What's the best HD performance we can?

2009-03-11 Thread Jon Bradley


On Mar 11, 2009, at 10:56 AM, George wrote:


What I'm doing on video:

Use an standalone Window component to contain a FLVPlayback (CS4
version), run full screen display mode on its stage alone. (Didn't set
'fullScreenSourceRect', as I tried, it cause worse performance
significantly)


Write your own. I'd stay away from FLVPlayback. Roll your own video  
player using NetStream and/or video classes along with scripts to  
control it.


Instead of using fullScreenSourceRect you can just try simple full  
screen mode and set up your controls properly. Flash has a pretty  
efficient full screen model now and also takes into consideration  
vertical blank (VBL) for smoother playback. I'm not so sure hardware  
scaling does that.



Video encode settings:
960x540, Field Oder - none (no interlace), profile - high, level -  
4.1,

frame rate - should be 30 or 29.97 fps, target bitrate - 1.5 mbps, max
bitrate - 2 mbps.


That sounds good.

Ensure no smoothing is on the video. Try to set the profile to  
main. High is more processor intensive. Drop the data rate in half  
as a test - though I'm guessing the results you get will be similar.  
It just might be your processor.



My question is:
- Does each AIR nativeWindow run its own thread, or the whole AIR
application running a single thread?


Certain things within Flash are multithreaded and will take advantage  
of multiple cores (bitmap filters, some vector ops, H.264 decoding  
and hardware scaling).


Flash itself runs in one thread (i think?). The only other thing with  
AIR that's unique is WebKit ... don't know much about that.



- What's the best practices for full screen high quality video in AIR?
Anything I can improve?


On an intel core 2 duo chip you should be able to do full screen 720p  
(1280x720) video at the least - and barely 1080p. Should being the  
operative word. Best practices here is all in the encoding and bit rate.


Check out the Adobe HD Gallery and see if you can run those videos on  
your test case. If you can't, you need a faster machine.


You can try FFMPEG to encode the H.264 video (x264 or mencoder). It  
does a great job and you get some nice additional encoding features  
that might give you a one-up on performance. That said, I think the  
latest Flash Media Encoder is pretty well tuned.



- How to GC after video played? I used videoplayer.clear(), but cannot
run videoplayer.close(), as I test when try to load a new video  
quickly,

it throw an error.


Not sure there's enough information to help here. What error are you  
getting? GC is automatic and you don't have much control with  
FLVPlayback.



- What's the best HD video performance we can get in multiple windows
Flex/AIR application?


One stream of H.264 encoded 1080p video for best performance on a  
dual core processor. More windows with more streams is possible but  
from a performance standpoint, you might need 2x as many cores as you  
have streams to play. I'm not sure how smart the multithreading is on  
the video decoding in Flash.


Some other thoughts:

1. I'd recommend trying WinXP Pro as a test case

2. Do not use any transparent border skin for the AIR Window. The  
custom border skin will kill the performance of your application  
anywhere from 10-20%


cheers,

Jon





Re: [flexcoders] Re: Flas 10 on mobile is a go

2009-02-17 Thread Jon Bradley


On Feb 16, 2009, at 10:43 PM, Anatole Tartakovsky wrote:


Jon,
That is assumption based on the current status quo and not counting  
Adobe's and community capabilities and hardware in 15 month from  
now. Touchscreen is very questionable in most cases - slow and not  
very accessible in real life.
I would expect other features to be way more important - as iPhone  
user but also early adopter of bunch of linux/windows/palm/nokia/ 
android smartphones as well as great dumb phones that have no  
problem to serve as trunking devices/routers for laptops. Here is  
what I think Flash 10 is destined to do:


Sure, things are certainly going to change. My comment was mainly  
restricted to that of the Palm devices. I don't even own an iPhone  
btw (ATT service quality where I live is abysmal) ... but I do have  
an iPod touch.


3. Integration APIs are really important - exposing bluetooth,  
accelerometers, GPS, camera, photo and multitude of voice codecs  
for input and output and all other standard capabilities.


I definitely agree with that. However, I wouldn't expect any  
integration of Flash technology other than camera/mic for quite a  
long time. Those are very platform specific functionalities that are  
unlikely to make it into Flash in the near term. Those APIs are  
certainly available on devices that have that capability.


3a. I wonder if Adobe can work on simultaneous integration of their  
technologies into supporting platforms the way Apple built their  
business - building ecosystem - either with free or low cost  
licensing of embeddable technology.


Adobe already does embedded licensing but I figure that low cost  
isn't really in the cards most of the time. That's something the  
developer needs to take up with Adobe directly.


Many embedded devices (like your description of a GPS display screen)  
utilize Flash as the primary display model, and Adobe prices their  
licensing for embedded devices based on those types of assumptions.


I really think that GMaps on iPhone are way better then top of the  
line car navigation system based on stale hard drive data. But  
iPhone screen is not usable while driving. On contrary, 7+ car  
display is perfect - but you can't transfer phones display there.  
Perfect application for Adobe display technology.


It's only better because of two things - design and interactivity.  
Blame that on the software developers for the embedded devices. Not  
making excuses, but embedded systems in vehicles have a very unique  
set of human factors issues.


Certainly going to be exciting to see where it goes.

cheers,

Jon



Re: [flexcoders] Re: Flas 10 on mobile is a go

2009-02-16 Thread Jon Bradley


On Feb 16, 2009, at 6:55 PM, Carlos Rovira wrote:

Hope Apple will see that other phones like this Palm Pre, with  
features like FP10, can make the iPhone goes down


Not if the touch screen and the rest of the UI stink.

The touch screen is, by far, the most important aspect of any smart  
phone, or device (like the ipod touch). There's no other device that  
comes even remotely close in terms of touch screen usability.


- j

Re: [flexcoders] New Web 2.0 Company looking for Chalnging work (www.dacoders.com)

2009-01-23 Thread Jon Bradley


On Jan 23, 2009, at 11:16 AM, Sajid Hussain wrote:

please review our company profile looking for favorable response   
as we are start up with tough time


Hour Rate : $12+ US


... no wonder a lot of developers are having a tough time finding  
work in the US (not all, but a lot).


- j

Re: [flexcoders] Re: Slow datagrid updates

2009-01-05 Thread Jon Bradley
Do you have a label component in one of the grid cells that has a  
width set to 100%, rather than an explicit size?


And, if so, do you have that label set to truncate?

If you do, that can easily cause slow redraw in a data grid. I've had  
it happen numerous times. Solution is to set label to a fixed width  
or turn off truncation on the label.


cheers,

jon


On Jan 5, 2009, at 11:44 AM, Jason B wrote:


Thanks for your reply Tracy, no i currently am not using renders in
the grid just a simple two column grid which has a value changed upon
button click and I'm not using Vbox just absolute layout.

the reason i dont care about undo is that the user can
change the value back by just clicking the button again.

i dont see anything that might throw off the grid but i'm going to try
to just put the grid into its own canvas and test it with only a few
items instead of this entire application.




Re: [flexcoders] Re: Padding/spacing before the first line in a TextArea

2008-12-16 Thread Jon Bradley
You can't manually remove that padding from the field. It's built  
into the field as the ascent of the font + 4 pixels for the natural  
field border (which also cannot be 'removed').


There are only two ways to shift up a field in Flash:

Method 1:
a. Bitmap snapshot of the text field
b. getColorRectBounds on the bitmap in question to retrieve a  
bounding rectangle of the non-alpha pixels.
c. Capture the top position from the Rectangle returned from that  
call and subtract that value from the y-position of the field.


Pros:
Will work every time

Cons:
Additional memory overhead. Tricky to do with the Flex component  
architecture - especially TextArea


Method 2:
a. Capture font metrics from the text field
b. Subtract (metrics.ascent + 4) from the text field y position. It  
is the ascent measurement, not descent.


Pros:
Less memory and less code to deal with.

Cons:
Will not work every time. Ascent and descent measurements from the  
font metrics within Flash are not accurate measurements and are only  
correct at very, very specific font sizes (8, 12, 17, 28, 36, 44 ...  
etc.).


Almost all point sizes of text return incorrect ascent and descent  
values in Flash. They usually return values less than they really are  
(7,8,9 point type will return the same ascent value for most fonts,  
for example).


Additionally, you'll still need to extend TextArea to handle the  
functionality.


Does not function well at all with advanced antialiasing ... also a  
known bug in the Flash text rendering. Saffron antialiasing causes a  
jump in the leading and position values of lines in a field, so don't  
use it.


--

This has been a long standing bug that I've been complaining to Adobe  
about. I've worked on applications for some big greeting card  
companies (take a couple guesses) creating a rendering system in  
Flash that will match Photoshop and Illustrator text rendering.  
Illustrator, btw, is the only Adobe application that let's you set  
the first baseline position of a text field using a variety of measures.


Good luck.

- jon


On Dec 16, 2008, at 8:53 AM, bjorn wrote:

Any ideas on where I might find more info about this? .. or people  
who might know more ...



2008/12/2 bjorn itrashm...@gmail.com
There is some padding before the first line in a TextArea. Have a  
look at this image to see what I mean:


http://i34.tinypic.com/4uz8s0.jpg

I need to remove this, and the first solution that comes to mind is  
to find that value and position the TextArea.y = TextArea.y - [that  
value]. The padding before the first line seems to be equal (in  
most cases) to the font's descent, which I can get from  
getTextLineMetrics().descent.


However, this is not true in all cases. In some cases, the padding  
is more.


Anyone have suggestions?





Re: [flexcoders] Flex Builder caching PNGs

2008-12-09 Thread Jon Bradley


On Dec 9, 2008, at 8:26 AM, tom s wrote:

How do I get Flex Builder to not cache the PNGs / to check for  
changes on each compile?


I think there's a bug there somewhere.

What I do is go into the class where the embed tag is and make a  
change to the embed tag, then save, then make the change back again.  
Then run/debug.


Works for me, even though it is a bit of a PITA.

cheers,

jon



Re: [flexcoders] SWF Verification

2008-11-24 Thread Jon Bradley


On Nov 24, 2008, at 5:09 PM, EECOLOR wrote:

It would be lovely to know how the Flash Player sends the hash of  
the currently running swf to the server for verification.


http://kb.adobe.com/selfservice/viewContent.do?externalId=kb405456

I don't think you can control how it sends the hash - it's done in  
the background by the Flash Player and connection to FMS.


What you do is upload a verified version of the SWF to the  
application directory - or a place where FMS can read it.


good luck,

jon



Re: [flexcoders] Panel as an itemrenderer in List ?

2008-11-04 Thread Jon Bradley


On Nov 4, 2008, at 8:48 AM, Nik Derewianka wrote:


1) The Panel does not display it's title bar or drop shadow bordering,
but seem to be displaying more as standard Box elements.

2) Trying to drag select text on a TextInput child in the panel item
renderer causes the containing List dragMove to trigger causing it to
try and drag the entire panel in the list, rather than just stay with
selecting the text.



For #1, I'm not sure what your code looks like so I don't know if I  
could offer any suggestions.


For #2, it sounds like you might need to add an event listener to  
dragMove and use preventDefault on the event, then use the Selection  
classes to set focus on the text instance and select it. Or, if  
possible, set dragMoveEnabled = false ?


best,

jon

Re: [flexcoders] FZip loads cached zip before downloading online

2008-10-17 Thread Jon Bradley


On Oct 17, 2008, at 10:17 AM, Kevin Benz wrote:


When I restart the application it looks like FZip is first checking
the temp folder for the cached zip and if found, it uses that one to
unzip, even if the zip was not completed the last time.

Does anyone know of a way to prevent that?


Compare file sizes.

cheers,

jon



Re: [flexcoders] FZip loads cached zip before downloading online

2008-10-17 Thread Jon Bradley


On Oct 17, 2008, at 10:17 AM, Kevin Benz wrote:


When I restart the application it looks like FZip is first checking
the temp folder for the cached zip and if found, it uses that one to
unzip, even if the zip was not completed the last time.

Does anyone know of a way to prevent that?


Scratch my last comment btw... duh... when you're not connected you  
have no idea if it's been completed.


What you can do is see if FZip will open up the ZIP archive that  
didn't download completely. You should have an error thrown that it's  
not valid because, well, the ZIP archive wouldn't be valid if it's  
not fully downloaded.


just a thought,

jb

Re: [flexcoders] dynamic TileList

2008-10-16 Thread Jon Bradley


On Oct 16, 2008, at 1:35 AM, arshak_navruzyan wrote:


I'd like to just specify the rowHeight=225 columnWidth=125 and let
the tilelist fill up the screen intelligently. Is this possible or am
I better off with a different control?


I might be reading this wrong but... that's how the TileList works

You can either specify an explicit number of rows/columns or just  
pass it a row height and column width and it'll fill up the available  
area.


cheers,

jon

Re: [flexcoders] your 3d engine

2008-09-26 Thread Jon Bradley


On Sep 26, 2008, at 7:17 AM, Michael Schmalle wrote:

Might want to make sure that you are sending to the actual private  
email before you hit send or it's all public,


Mike



Eh, no worries. :)

- j

Re: [flexcoders] Not to harp on about it....

2008-09-26 Thread Jon Bradley


On Sep 25, 2008, at 1:28 PM, Samuel Colak wrote:

If you want to be pedantic, yes its written in AS3 using Flex  
(hence flexcoders !!)


Pepervision is written using Flash


All 3d engines are written in Actionscript. AS3 is AS3, doesn't  
matter what program you used to compile the final SWF.


Both Away3D and PV3D engines work perfectly fine with Flex. The  
difference is that in Flex Builder, you have to create a UIComponent  
class to add the scene to your view. Everything else is the same.


The Flex framework is AS3, as is any code written in the Flash IDE  
(and published to Flash 9). Flex Builder is just a way of compiling  
SWF files from writing a combination of MXML and AS3 (among some  
other things).


The end result is still the same - actionscript code that executes in  
the Flash Player.


PV3D and Away3D are easy to use in Flex Builder, btw.

- jb



Re: [flexcoders] Not to harp on about it....

2008-09-26 Thread Jon Bradley


On Sep 25, 2008, at 2:00 PM, Ryan Graham wrote:

Isn't Flash Player 10 going to have some basic 3D support built in?  
I thought I read that somewhere. Should be awesome if so...


It does, but it only provides marginal speed improvements.

- jon

Re: [flexcoders] Not to harp on about it....

2008-09-26 Thread Jon Bradley


On Sep 25, 2008, at 12:15 PM, Doug McCune wrote:


I didn't mean to come off as rude :) Writing your own 3D engine is a
huge undertaking and it's an impressive accomplishment. Congrats on
the work.

Is it going to be released (open source?)



I think Sam's confusion was related to how the engine was implemented.

I haven't seen anything yet, but he might be implying that the engine  
was built as a collection of custom UIComponent elements that can be  
nested with MXML to make your scenes and objects - ie, Degrafa for 3d  
(which would be pretty cool).


That's my take on it at least. : ) If so, that would certainly be a  
bit novel.


cheers,

jon

Re: [flexcoders] FileReference to ByteArray

2008-09-26 Thread Jon Bradley


On Sep 26, 2008, at 4:48 AM, aytuganov wrote:


Does somebody know is it possible to select file using
FileReference.browse() and than set it to ByteArray instance.
(There is an object that has an ByteArray property. I have to set this
property and send the object to server using RemoteObject - but it's
not a matter)


In Flash 10.

You have no access to the content of a FileReference object or item  
in any version of Flash earlier than v10. That's a resounding answer  
of no.


There may be ways to hack the HTTPHeader information to include  
additional content information when the FileReference is uploaded.  
Otherwise, you'll need to send that data separately to the server.


good luck,

jon

Re: [flexcoders] your 3d engine

2008-09-25 Thread Jon Bradley


On Sep 25, 2008, at 12:54 PM, Samuel Colak wrote:


Jon,

There is really no api documentation - im looking to release the  
code line into the community or basically
just keep this internal. I've done alot of work into getting the  
framerate acceptable without hitting the CPU dramatically.



Samuel,

Sounds cool.  Definitely would like to have a look at some point,  
especially if you got he OS route.


As far as your statement on flexcoders that this is all written in  
Flex .. does that imply that you didn't use any AS to write this  
stuff? I see classes referenced in the code that you sent as a  
snippet in the last email (com.***).


cheers,

jon



Re: [flexcoders] PopupButton Background Color

2008-09-23 Thread Jon Bradley


On Sep 23, 2008, at 10:02 AM, itdanny2002 wrote:


I want totally black background with a white text
rather than gradient background.


I believe the PopUpButton control uses the highlightAlphas properties  
to draw a highlight on the button (so it's not the background that  
you are seeing get the gradient, it's the highlight).


Add the following to your PopUpButton CSS definition ( i think ):

highlightAlphas:0.0,0.0;

good luck,

jon

Re: [flexcoders] scale9Grid: What am I missing?

2008-09-23 Thread Jon Bradley


On Sep 23, 2008, at 10:55 AM, Amy wrote:


mx:Image id=backgroundImage source={windowImage} width=1000 /


You're missing the height parameter. I think this is necessary -  
either as a percent or static value - to force the image component  
resize.


You can also try adding scaleContent=true to that.

cheers,

jon





Re: [flexcoders] Re: PopupButton Background Color

2008-09-23 Thread Jon Bradley


On Sep 23, 2008, at 10:47 AM, itdanny2002 wrote:


Jon, it works on purely black but not on purely white
any idea ?



Not sure. I don't particularly have time to check it out.

Highlight is drawn as white, and is something that, oddly, the  
framework engineers failed to include as a CSS driven property (why,  
who knows).


So, on white you should not see the highlight. You're more than  
likely seeing your background.


Maybe set the backgroundAlpha:0.0; in the CSS so that it doesn't  
show at all? Also feel free to set borderStyle:none and/or  
borderAlpha:0.0 just to be certain.


I don't recall if border styles affect the highlight for the Button  
control, which PopUpButton extends. It does for some other controls  
(Panel).


- jb

Re: [flexcoders] scale9Grid: What am I missing?

2008-09-23 Thread Jon Bradley


On Sep 23, 2008, at 11:02 AM, Michael Schmalle wrote:

I remember something weird about this, try loosing the apostrophe's  
around the numbers.


Good catch.

I haven't run into that in a long time probably because I've been  
setting this stuff through AS now (or skins).


- j

Re: [flexcoders] baselinePosition meaning?

2008-09-17 Thread Jon Bradley


On Sep 17, 2008, at 12:13 PM, Sherif Abdou wrote:

Ok let me answer my question, after playing around and changing it  
up, is it basically an Imaginary Line where It is used to align  
control like have the label in the formItem be centered to the  
TextInput control?


Ryan added some useful information ... I'll add some more, that's  
related somewhat.


The baselinePosition and line heights in Flash are wrong, when  
compared to how it's handled by Photoshop, Illustrator and InDesign.  
Ascent and descent are supposed to be used to calculate a proper  
baseline position, and Flash does not properly calculate ascent/ 
descent metrics.


I did an application for a card company and we had serious issues  
with the discrepancy between Flash, Photoshop, Illustrator and  
InDesign when it came to proper rendering of text fields and line  
heights.


The baseline position is measured differently between each of the  
applications (incorrectly in the case of Photoshop and Flash). In  
Flash, it's a major headache because the ascent and descent  
measurement from text metrics are wrong 90% of the time. Illustrator  
is the only app that renders the first baseline (using em size)  
correctly from a print standpoint. At least with Photoshop you can  
hack the file format to fix it.


In general, be careful when you use any print-matching calculations  
with baselines or leading in Flash.


Related ...

Leading in Flash will only be correct on awkward point sizes. The  
leading is also not consistent from line-to-line if you try to  
manually override it (using some funky math to convert em size to  
flash's desired values).


If you try to set a line height of, say, 40 points on 40 pt type, you  
actually get somthing like 46.8, which can't render because Flash can  
only do integer line heights. That's not considering that the line  
height Flash renders with the absolutely wrong value in the first place.


Good luck playing with it if you want to. It's a big can of worms.

Side note, in Flash 10 it's is better, but still wrong on metrics.

- jon



Re: [flexcoders] A way to control all rounded corners on Container?

2008-09-16 Thread Jon Bradley


On Sep 16, 2008, at 4:40 PM, djepyon wrote:


Maybe I ought to be making a container component with the CS3 export
kit, but does anyone know of a way to round bl and br on a
Box/HBox/VBox while tl and tr are square?


In my opinion, the best way is to subclass mx.skins.halo.HaloBorder.

In that new class, override the updateDisplayList method. Add  
something like the following to it:


var r:Number = getStyle(cornerRadius) as Number;
if (!r) r = 0;  

GraphicsUtil.drawRoundRectComplex(g, 0,0,  
unscaledWidth,unscaledHeight, 0, 0, r, r);


You may need to adjust the top left and the width/height that's drawn  
based on the corner radius size.


After you've done that, for each of the controls, add a line in CSS  
for those controls like the following:


borderSkin: ClassReference(com.yourpath.YourBorderSkinClass);
cornerRadius: 10;

 I just went through this with Panel recently because I needed a  
very custom designed panel and header (for Panel, you extend  
PanelSkin instead of HaloBorder). The process for the other  
containers is pretty much the same.


good luck,

jon



Re: [flexcoders] Flash video component?

2008-09-11 Thread Jon Bradley

On Sep 11, 2008, at 12:22 PM, markflex2007 wrote:


which component in Flex to take place the Video component in Flash.



mx.controls.VideoDisplay I believe.

Has no UI components associated with it. You'll need to add those  
yourself. Or, you can always output an SWF of a video player built in  
Flash and import that into Flex, passing it the required params.


Or you could even use the updated CS3 video player and export it as  
an SWC and use that in code, if you need that level of control (note,  
I haven't actually tried that yet).


cheers,

jon

Re: [flexcoders] Results of Direct Phone Call to Scene7.com

2008-08-28 Thread Jon Bradley


On Aug 28, 2008, at 4:18 PM, Robert Thompson wrote:

I have just talked some another person at Scene7.com and the  
indication I seemed to have gotten is that there will be a resulting  
complication in the area of eCommerce and Product Catalog  
Development to the FLEX community.


Scene7 is nothing more than another collection of services that have  
been around for years, already, in many different forms.


You're concerned about competition. Fair concern. Unfounded in my  
opinion, but that's your issue.


We have a framework we use (Flex is Flash), and we all have our own  
choices of server-side development.


Scene7 is most likely built upon the Adobe Graphics Server and  
LiveCycle. The combination of these two application offerings in their  
full configuration, I believe, exceeds $200K. Flex just happens to be  
the UI.


The fact that Flex is the UI for building this stuff has got little to  
nothing to do with it.


- j

Re: [flexcoders] Scene7.com Webinar on 9/11/08, ask some serious questions, examine answers seriously, see if they're answered with depth

2008-08-27 Thread Jon Bradley


On Aug 27, 2008, at 5:56 PM, Robert Thompson wrote:

Will they go too far?  Microsoft did.  Do you own research on that  
if you wondered what happened in the 90's.  There's plenty of it.   
The case is posted, Discovery, Judgement.


I want some of what you're smoking. :P

I don't see how this is relevant to anything really. Aint going to  
affect 99.9% of us and this whole thread is just trolling imho.


- j

Re: [flexcoders] Re: Take the latest Adobe Developer Survey

2008-08-15 Thread Jon Bradley


On Aug 13, 2008, at 7:50 PM, Amy wrote:


I've been applying for Flex jobs lately and finding that, whether the
posting includes .net experience or not, they pretty much  
automatically

eliminate you if you don't have it. It would seem to me to be self-
evident that if you can pick up any backend technology and Flex
that .net is unlikely to be beyond your reach. But that's not how the
people filling these jobs think, unfortunately.



I personally find it Awkward that employers are expecting server-side  
programming expertise along with front-end programming expertise,  
like Flex.


Hopefully they're willing to shell out serious capital for that skill  
set.


- jon

Re: [flexcoders] Event Phase clarification bubbling - please Diagram

2008-08-06 Thread Jon Bradley

On Aug 6, 2008, at 12:48 PM, Ralf Bokelberg wrote:


for each( var component in [this, hb1, hb2, b1, hb3])


Hadn't seen that done before.

nice.

The only downside to the whole event bubbling hooplah is that all  
your components, and all your children need to extend EventDispatcher  
or some component that extends it. Otherwise, you have to manually  
handle the re-dispatching of the event your self, basically bubbling  
the event manually through the chain.


- jon

Re: [flexcoders] Re: Flex Tree having 20000 nodes crashes

2008-08-04 Thread Jon Bradley


On Aug 4, 2008, at 10:48 AM, Guilherme Blanco wrote:


I have implemented a DynamicTree for my own usage, after spending
almost a week looking for an URL about this subject.
Until now, I haven't seen any implementation, and I plan to write a
pot in my blog about it.


Great post, Guilherme!

Thanks for adding that to the archives.

cheers,

jon

Re: [flexcoders] Flex Tree having 20000 nodes crashes

2008-08-02 Thread Jon Bradley


On Aug 2, 2008, at 7:25 AM, profiles_arun wrote:


I have a tree, which has 21000 plus nodes, when i load the .swf file
in IE, it crashes. As such i dont get any error messages, so i
checked into widows application error log and found this error

Faulting application iexplore.exe, version 7.0.6000.16674, faulting
module fldbg9f.ocx, version 9.0.124.0, fault address 0x00241305.


Your first problem is how much data you are loading into a tree. In my  
opinion, there is no reason to be doing that.


Second problem, IE 7. It's the absolute worst browser on the planet  
with CPU and memory management. Try this in Firefox. Although you  
might crash, it will probably take longer to crash (unless there's a  
bug in the debug flash player).



Below is the snippet of my impl. Please suggest a solution, to
overcome this issue.


Your solution to overcome the issue is as you already found - don't  
try to load that much information into a Tree.


cheers,

jon

Re: [flexcoders] Re: Zoom Tile Container

2008-07-28 Thread Jon Bradley

http://demo.quietlyscheming.com/fisheye/TileExplorer.html

On Jul 25, 2008, at 4:00 PM, Nate Pearson wrote:


Bump. Any ideas?




Re: [flexcoders] I need a gzip library to read gzip files on the fly?? is this possible?

2008-07-17 Thread Jon Bradley

Nochump's AS3 Zip Library.

http://nochump.com/blog/?p=15

Be careful with large zip files though, because you'll get script  
timeout errors.


Any zip greater than 1 MB or more will generally cause problems  
unless you modify the source to decode zip entries in chunks, rather  
than in a whole mess of loops. I've modified it and have had very  
good use out of it.


I think this will hangle .gz files fine.

cheers,

jon



On Jul 16, 2008, at 5:42 PM, luvfotography wrote:


I need a way to read a gzip file 'http://www.myhost.com/myfile.gz'
Is there a way to do this?
I found a library for air, but I need it for flex.
http://weblogs.macromedia.com/mchotin/archives/2004/11/ 
enabling_gzip_c.html

thanks,




Re: [flexcoders] Copied project gives security sandbox violation

2008-07-10 Thread Jon Bradley


On Jul 10, 2008, at 8:36 AM, valdhor wrote:


Once this was complete and compiled it gives me a security sandbox
violation for every remote call. Cleaning the project has no effect.


Did you per chance modify the compiler options for the first project?

I might've seen this before, but make sure that the new project you  
created has the additional compiler option -use-network=true.


Just a stab in the dark

good luck,

jon



Re: [flexcoders] Re: Cairngorm concepts

2008-07-10 Thread Jon Bradley


On Jul 10, 2008, at 11:33 AM, oscar.12321 wrote:


I seems to me that commands are not user gestures, nor clicks or
backend queries. The only posible explanation to me is as use cases
are abstract (What kind of things can the the user do?) so there is no
a fixed rule.


In my experience, use cases are more appropriately tied to events,  
not commands.



In essence a methodology to identify commands could be:
1. Try to hold the view state in the view.


Yea, but that's not necessarily always the case. Consider the states  
Logged in/out. Those two states are application level and are  
something that typically would be stored in the application model  
locator.


Remember, state can be global (application) or micro (mini mvc, or mv  
only). You might have a portion of your application that works on,  
say, a selected item, such as selecting an item and modifying it's  
properties before adding it to a cart. This situation doesn't need a  
selected item in the main application model.


There are applications that, for example, might be geared toward  
working on a collection of elements and all views and portions of the  
application need to bind to that (not a storefront-type app).


Let's say you write an image editing application. The selected image  
that is being edited would be stored in the application model because  
everything in the application aside from selecting the image to edit  
performs operations on this selected image.


Here you'd have the global 'selectedImage' property in the model that  
views bind to, but then the view collections themselves may have a  
local copy of that to work on (for undo/redo functionality, for  
example).



2. Determine the use cases, and make a command for each one.


Not all the time. Some use cases are such that they kick off a chain  
of events. For sake of argument, let's say 'addToCartEvent' has three  
other events that need to occur before the final 'addToCartCommand  
is executed. Lots of things can happen in a use case life cycle.



3. Any backend query is also a command.


Not necessarily either. It may be a single command with a collection  
of delegates.



4. If you need to update the model from the view, don't do it
directly. You have discovered a new command an probably a use case.


That I do agree with. I never have my views modify the model  
directly. That's generally frowned upon (though I'm sure there are  
limited situations where this might be beneficial).


just my 0.02.

good luck with your experimentations with the framework.

cheers,

jon

Re: [flexcoders] Allow negative x position of container child

2008-06-18 Thread Jon Bradley


On Jun 18, 2008, at 10:16 AM, DannyT wrote:

The overall goal is to create a UI that allows the display of items  
1 and 2 OR items 2 and 3 and the view will slide into the chosen  
formation. However I seem to be stuck at the first hurdle. I've  
tried playing around with borders, scrollPolicy and clipContent but  
not yet managed to get any nearer. Any help much appreciated.



Use a Canvas parent container and you should be ok with negative  
positioning.


An HBox overrides the positions of it's children, the children don't  
position themselves.


Then, just create some transition tags and set moveEffect=Move on  
each of the children.


cheers,

Jon



[flexcoders] PopUpButton custom component with styles

2008-06-12 Thread Jon Bradley
Got a bit of an issue here I can't seem to resolve.

I've got a PopUpButton that opens up a custom component (mxml VBox  
and mxml Canvas). These both use a styleName tag on them.

Unfortunately, the PopUpButton doesn't inherit any styles into the  
popup that is created and I can't get the styles to display for the  
life of me. I've tried regenerating style cache, tried hacking the  
PopUpButton class itself to force the owner to be the parent  
application ... nothing will take.

So, how can I force any and all custom styles to be applied to any  
component or control that is used as a popup for the PopUpButton?

Seems pretty lame that the custom styles won't display, when they do  
in every other context.

thanks,

jon


Re: [flexcoders] know if .browse() was executed or not

2008-06-09 Thread Jon Bradley

On Jun 9, 2008, at 4:40 AM, David Pariente wrote:

 The only problem is that if user selects a file several times in  
 the same file_select button, it would keep getting files inside  
 that array, even i just need the last one that he chooses.

Not if you make sure the file doesn't already exist in the array.

This is where you'd use the .name property to check to see if it's  
already in the array - if so, skip it or throw up an Alert dialog or  
something. Otherwise, push it into the array.

- jb


Re: [flexcoders] new to VO's, why won't this cast?

2008-06-09 Thread Jon Bradley


On Jun 9, 2008, at 1:54 PM, Derrick Anderson wrote:

var testVO:EmployeeVO = DataGrid(event.currentTarget).selectedItem  
as EmployeeVO;


Maybe this will help:

var testVO:EmployeeVO = EmployeeVO(event.currentTarget.selectedItem);

or

var testVO:EmployeeVO = event.currentTarget.selectedItem as EmployeeVO;


good luck,

jon

Re: [flexcoders] know if .browse() was executed or not

2008-06-06 Thread Jon Bradley


On Jun 6, 2008, at 4:26 AM, David Pariente wrote:

The point is that, IN ANOTHER POINT OF THE CODE, i wanna send the  
files.
the on_select is not useful for me. i will not send anything  
on_select, just put a pair of lines of code there.



My opinion is that you are thinking about this too much. You do not  
need to have a boolean to determine if a file was selected.


What you need is an array that you populate with the filled  
FileReference instances in the Event.SELECTED event handler. When the  
user clicks SEND on your application, you loop over your array of  
stored FileReference instances and upload each of them.


So in the onSelect function for Event.SELECTED, just push the  
FileReference into the array. Event.SELECTED shouldn't get broadcast  
unless a file is actually selected anyway.


Whether or not your FileReference elements are stored in different  
views doesn't matter - just so long as your array is accessible by  
all of them so the FileReference instance can be added.


private var fileList:Array = new Array();
private function onSelectFile(event:Event):void
{
var file:FileReference = FileReference(event.target);
  fileList.push(file);
}


jon

Re: [flexcoders] PDF into Flex

2008-06-06 Thread Jon Bradley


On Jun 5, 2008, at 10:17 PM, Dels wrote:


My question is, can I embed the PDF into the first half of the
HDividedBox? if it's a yes, how do I do it?


Embed a PDF file? You can't put PDF files in Flex (Flash) - unless  
I'm missing something.


You can use Flash Paper though...

-jon




Re: [flexcoders] Re: PDF into Flex

2008-06-06 Thread Jon Bradley


On Jun 6, 2008, at 9:17 AM, valdhor wrote:


You can if you are using AIR. From the manual...

AIR applications can render not only SWF and HTML content but also PDF
content. AIR applications render PDF content using the HTMLLoader
class, the WebKit engine, and the Adobe Reader browser plug-in.


Yea, I probably should've mentioned it was an AIR only capability.

cheers,

jn

Re: [flexcoders] Re: #2038: File I/O Error only in firefox

2008-06-05 Thread Jon Bradley
I'm guessing it's because the session is not retained when performing  
a file upload to the server - a new session id is created for each  
FileReference upload attempt.


This is a known issue with various workarounds.

Modify your server code to ignore any session or login details to be  
sure this is the problem you are seeing. If it works when you remove  
any requirement for authentication or any check of the session info,  
then you're one step closer to fixing the issue.


You will then need to:

1. Store the session number in Flex and send it back. On the server  
you validate against the sent session (a new one will still be  
created), then send back the new session details.


or...

2. Ignore a requirement on the session when doing the actual upload.  
Find another way of verifying the user is logged in.


http://bugs.adobe.com/jira/browse/SDK-12851
http://bugs.adobe.com/jira/browse/FP-78
http://thanksmister.com/?p=59
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg58372.html


good luck,

jon


On Jun 5, 2008, at 12:58 PM, Dennis Falling wrote:

I have this problem for standard uploads too, not just SSL...   
Again, it works fine in IE, so I know that the address and file are  
valid.  Any ideas?



On Wed, Jun 4, 2008 at 1:48 PM, Dennis Falling [EMAIL PROTECTED]  
wrote:
I searched the web and the group and found a thread going about  
this without a resolution (started with msg. 88102).  Does anyone  
know a way around this?  I need to allow the user to upload files  
over SSL, which works fine from IE but explodes in Firefox.


Code:
var url:String = Services.getCommandServiceURL 
(FileDelegate.UPLOAD_FILE_COMMAND);

var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
_file.upload(request,fileData,false);

When run in Firefox, I get a flash exception:
Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O  
Error.


Watching it in Wireshark I see the initial post, then a number of  
subsequent lines Continuation or non-HTTP traffic.


Thanks!




Re: [flexcoders] know if .browse() was executed or not

2008-06-05 Thread Jon Bradley


On Jun 5, 2008, at 12:23 PM, David Pariente wrote:

I was trying checking for some property from fileReference object,  
like for example .name, so if no name on the object, would mean  
they didn't select anything there. But accessing the name property  
when no file choosen throws an IllegalOperationError.


Anyone has idea how to know if file was selected or not???


Use events. EVENT.SELECT is dispatched when the browse() session  
closes and files are selected. The list of files is the fileList  
property on the FileReferenceList instance you created.


private function addFiles():void
{
myFileReferenceList = new FileReferenceList();
try
{
var success:Boolean = myFileReferenceList.browse();
myFileReferenceList.addEventListener(Event.SELECT, 
onSelectFile);
}
catch (error:Error)
{
// Handle errors, or add listeners in the try block for errors
}
}

// Called when files are selected
private function onSelectFile(event:Event):void
{
if (myFileReferenceList.fileList.length = 1)
{
for (var i:Number = 0; i  myFileReferenceList.fileList.length; 
j++)
{
// whatever you want to do with the list of files
}
}
else
{
//  no files selected
}
}


cheers,

jon

Re: [flexcoders] know if .browse() was executed or not

2008-06-05 Thread Jon Bradley


On Jun 5, 2008, at 1:40 PM, David Pariente wrote:

Im not using a fileReferenceList, but a FileReference. And it seems  
i can't access any property of FileReference unless i have choosen  
a file. So there is no way to know if a file was selected.



Ok.  Then all you need to do is use FileReference instead of  
FileReferenceList. There is not much to change in the code.


Any attempt to get the .name property before the select event is  
dispatched will result in an IllegalOperationError (because you can't  
even look at name until Event.SELECT is dispatched).


So, in the onSelectFile method that I posted, .name will then be  
available - it will be null if no file was selected. Additionally,  
check the documentation on browse(). You might be doing something  
else funky that is wrong - such as messing with typelist and not  
providing descriptions or extension strings. There are a few things  
that would cause the browse() not to return true.


The following should work (not tested).

private var isBrowsingFile:Boolean = false;
private function addFiles():void
{
myFileReference = new FileReference();
if (!isBrowsingFile) {
try
{
isBrowsingFile = myFileReference.browse();
myFileReference.addEventListener(Event.SELECT, 
onSelectFile);
}
catch (error:Error)
{
isBrowsingFile = false;
// Handle errors, or add listeners in the try block for 
errors
// This is where you would get the IllegalOperationError
}
}
else
{
trace(already browsing for a file);
}
}

// Called when file is selected
private function onSelectFile(event:Event):void
{
isBrowsingFile = false;
if (myFileReference.name)
{
// whatever you want to do with the selected file
}
else
{
//  no file selected
}
}

good luck with it,

jon



Re: [flexcoders] Flex Kiosk Development

2008-06-03 Thread Jon Bradley


On Jun 3, 2008, at 6:55 AM, Michael Trim wrote:


I am interested in evidence (even anecdotal) for or against using the
Flex Framework / UI Components and Cairngorm for applications that  
must

remain stable for long periods of time under heavy, sustained use.


This isn't a Flex specific question, unless you are concerned about  
bugs or memory leaks in the framework itself.


That's more of a question whether or not the Flash Player itself is  
stable enough for Kiosks — it is.


One major thing to be concerned with is the loading / unloading of  
content dynamically into the Player. It has a few memory leaks that  
could bring your app to a crawl. If the application is running for a  
long period of time, the memory will generally get cleared, better  
than when running in the browser plugin in my experience.


good luck.

jon

Re: [flexcoders] Irregular Polygon Area

2008-05-21 Thread Jon Bradley


On May 21, 2008, at 7:10 AM, rleuthold wrote:

Does somebody know of a class which calculates the area of an  
irregular polygon ?


If it's not a self-intersecting polygon:

1/2 * ((x1+x2)(y1-y2)+(x2+x3)(y2-y3)+...+(xn+x1)(yn-y1))

The generalized method is basically:

1/2 * ( Sum from 0 to n-1) (Xn * Yn+1) - (Xn+1 * Yn)

For a self-intersecting polygon it's quite complicated.

good luck,

jon

Re: [flexcoders] Lucida Grande normal weight font cannot be embedded

2008-05-20 Thread Jon Bradley
Have either of you tried to compile with one of the other font  
managers to see if that works?


Flex 3 uses the AFEFontManager by default I believe. You may have  
better luck with the BatikFontManager but you may run into glyph  
encoding issues (d/e/p and rounded edges have less than adequate  
curve data).


Set your compiler options to one of the following:

-managers=flash.fonts.AFEFontManager
-managers=flash.fonts.BatikFontManager
-managers=flash.fonts.JREFontManager

For Batik and JRE font managers, you may also need to specify the  
compiler to use backward compatibility (not sure):


-compatibility-version=2.0.1

For more information to modify the flex-config.xml:

http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_10.html

good luck,

jon


On May 20, 2008, at 12:05 PM, David Pariente wrote:

If u find a solution please tell us, i got that problem with a pair  
of specific fonts too :(


- Mensaje original 
De: Ben Clinkinbeard [EMAIL PROTECTED]
Para: flexcoders@yahoogroups.com
Enviado: martes, 20 de mayo, 2008 16:28:46
Asunto: Re: [flexcoders] Lucida Grande normal weight font cannot be  
embedded


Yea, I tried all kinds of combinations, including the expected  
fontWeight: normal;


Ben





Re: [flexcoders] GIF image doesn't blinking in Flex App

2008-04-28 Thread Jon Bradley


On Apr 28, 2008, at 8:13 AM, Nirav Upadhyay wrote:


Hi,

I have put one GIF image of blinking star in my Flex Application  
but image doesn't blink at all. It looks like simple JPEG image  
although it is a GIF image.

What to do?


Because animated GIF images are not supported?

Check this out:

http://www.bytearray.org/?p=95

good luck,

jon

Re: [flexcoders] GIF image doesn't blinking in Flex App

2008-04-28 Thread Jon Bradley


On Apr 28, 2008, at 8:37 AM, Nirav Upadhyay wrote:


Thanks for reply.
So you mean that animated GIF images are not supported by any  
version of Flex (2.0/3.0?


I don't think this is a Flex issue. Rather, it's the fact that  
animated GIF is not supported by the Flash Player.


cheers,

jon

Re: [flexcoders] Need help buying Flex licenses in US$ - Intl prices are highway robbery!

2008-04-17 Thread Jon Bradley


On Apr 17, 2008, at 8:16 AM, Glenn Williams wrote:


It drives me mad this one.

There really is no justification in UK users paying over the odds.


There is some justification (though it's pretty minor). Software  
licensing laws in the UK are different than in the US - they are much  
more user-centric and implemented to protect the purchaser in many  
more ways than US users. Wish we had some of the same protections.


In the US we have almost no recourse if a product does not function  
in the manner we expect it to. That's not the case in the UK. These  
software functionality guarantees and indemnity laws 'force' software  
developers to charge more for their product. I can't speak about  
other countries.


I personally believe it's a rip off.

Anyway. It's generally illegal to purchase software outside of your  
country. IE, purchasing from a US store and using the product in  
Australia or the UK. I believe it is 100% against the license you  
agree to when using the Adobe software products.


The price differential is annoying though, no doubt.

- jb

Re: [flexcoders] Re: graphics object seems to degrade performance

2008-04-15 Thread Jon Bradley


On Apr 15, 2008, at 12:23 AM, Eric Cooper wrote:

I am wondering, though, if I would get this for free if I used  
DisplayObject and the built-
in drag events. I am also wondering, if I am saving that much in  
terms of memory and

speed, by rolling my own as it were.


My personal choice was not to use any of the built-in drag event  
stuff for this.


I created my own handler for clicking and 'selecting' or initiating a  
drag or other transform on a display object using transformation  
matrices. Objects extend some base classes that implement an  
interface containing a setTransformation method. Each object can then  
override the capabilities of the transformation that is being applied  
(as a matrix parameter).


I find it pretty weird you run into issues with more than 10 display  
objects. I would imaging you'd have issues with a few hundred or  
thousand, but not low single digits.


If you get to really complex vector shapes dragging can slow down  
quickly because the renderer has to deal with visibility and  
compositing of that complex shape. Bitmap representations here are  
much more efficient, using cacheAsBitmap=true (gotta extend  
movieclip) and have your class that contains the graphics  
automatically handle the drawing of the bitmap into itself. I do this  
with text because animating or moving type in a layered 'canvas' has  
performance and display issues.


My 0.02.

cheers,

jon

Re: [flexcoders] Best .NET AMF Implimentation?

2008-04-15 Thread Jon Bradley
WebORB in my opinion. I think it beats out Flourine and AMF.NET. It's  
free but there's a license agreement.


They make their money on support agreements, which in my opinion is a  
excellent model if you need to have a certain level of service  
associated with your implementation of their software.


http://www.themidnightcoders.com/weborb/dotnet/index.shtm

cheers,

jon



On Apr 15, 2008, at 11:52 AM, Nate Pearson wrote:


I want to use a free implimentation with .net and AMF.

Does anyone have any experience? Which is the best?

I'm looking at AMF.NET and fluorine right now.

Thanks,

-Nate




Shared Fonts Solution - Re: [flexcoders] Shared Fonts Hell

2008-04-11 Thread Jon Bradley

Mario,

Here's how I do it, relevant code contained for the list archives and  
those that also run into this problem. I changed the title of the  
response so that it can be flagged as a solution to the problem (is  
there a standard practice for solutions in this list?).


1. Create a separate Flex project for the Font Library. The end  
result of this project (an Actionscript-only project) is to create  
each font as an SWF file.


a. Create a Font class that all your fonts will extend. I do this so  
that additional properties may be added to the fonts themselves that  
you can use during your runtime application. Things like a  
displayName so that you can logically display the name of the font  
however you want in a ComboBox for examples.


package
{
import flash.display.Sprite;
import flash.text.Font;

public class MyFontBase extends Sprite
{
public var registeredFontName:String;
public var displayName:String;
public function MyFontBase():void { }
}
}

b. Create the classes with the actual embedded font. Note that  
depending on what type of font you need, you will probably run into  
compiler issues. Some system fonts just fail to compile. After you've  
created all your AS files for the fonts, make sure to go to your Flex  
project properties and set all of these files as runnable  
applications. Each will get compiled to an SWF that you load in at  
runtime in your other project.


package {

import flash.display.Sprite;
import flash.text.Font;
import MyFontBase;

public class ArialFontLib extends MyFontBase {

[Embed(source='/fonts/arial.ttf', fontName='ArialRegular',  
mimeType='application/x-font')]

public static var ArialRegularFont:Class;

/** Register the font directly as soon as this class is initialized 
*/
public function ArialFontLib():void {
registeredFontName = ArialRegular;
displayName = Arial;
Font.registerFont(ArialFontLib.ArialRegularFont);
}
}
}

c. Notice that the font classes register themselves against the Flex  
Font class, instead of you doing it separately somewhere else down  
the pipeline.


2. In your new Flex Project that will load these library files,  
create a class that loads up these SWF files and broadcasts when each  
of them has completed loading. Might want to add in a broadcast that  
says when all of them are done loading as well. I can't share my code  
for this because my FontManager class is pretty in depth and does a  
bunch of other stuff. It's the standard loading of content though.  
Here's the final dispatch so you can see how it ties in with the  
function that applies the styles:


//  Dispatch event that the font loaded
dispatchEvent(new FontManagerEvent(FontManagerEvent.FONT_LOADED,  
false, false, Sprite(event.target.loader.content) ) );


a. Create a function in your new Flex project that listens for the  
fonts that load and when each one completes. This function applies a  
new CSSStyleDeclaration to that loaded font and makes it available.  
Finally, make sure the StyleManager creates this new style declaration.


/** Apply the stylesheet globally for this loaded font */
private function onFontLoaded(event:FontManagerEvent) : void {
	var fontName:String = MyFontBase 
( event.loadedFont ).registeredFontName;

var style:CSSStyleDeclaration = new CSSStyleDeclaration();
style.setStyle('fontSize', 12);
style.setStyle('fontFamily', fontName);
StyleManager.setStyleDeclaration(. + fontName, style, true);
}

b. Now the font is registered in the StyleManager as a new style  
declaration. You can use this on any of the Flex controls in your  
application. You can also use this in custom components that are  
created after you've loaded the fonts (like a custom UITextField  
display). Note that you may need to add:


regenerateStyleCache(true);

within the constructor of your custom UIComponent so that the styles  
that were loaded at runtime are going to propagate to your custom  
component.


I did not include here the other implementation that I use with  
FlashType (fonts exported from the Flash IDE). The process is very  
similar but you need to take special care that the fontAntiAliasType  
style declaration is set properly or you'll get runtime errors.


There are also ways of managing the various weights of the font  
within a single class. You can look that up online and extrapolate  
those implementations to the process I've detailed above.


good luck,

jon

Re: [flexcoders] Re: What do you think of UM Cairngorm Extensions,especially for Modular Apps?

2008-04-11 Thread Jon Bradley
Ben,

Question for you. I've been looking at the UM extensions as well. How  
about your support for chaining? From what I've seen it's chaining  
commands, not events.

My main needs are to chain events, and right now I'm using a very  
wordy (ie, many class files) to do that. Separate classes for a  
chained version of each event.

A description/implementation example on the download page, or some  
reference would be really useful here.

thanks,

jon


Re: [flexcoders] Re: What do you think of UM Cairngorm Extensions,especially for Modular Apps?

2008-04-11 Thread Jon Bradley


On Apr 11, 2008, at 2:56 PM, ben.clinkinbeard wrote:


Hi Jon,

I don't really know what you mean by chained events, can you
elaborate? I should also point out I have only been using UM Cairngorm
for a couple of months and don't feel like my head is completely
around it quite yet. More than happy to try answering your question if
you can clarify though.



Actually, I think it is chaining commands I need. Just looking to do  
it in a much easier fashion so that I can keep the same commands that  
can be used by themselves - and not actually put any chaining  
information within the command itself (ie, a higher level command  
executer for the chaining).


thanks,

jon




Re: [flexcoders] Re: What do you think of UM Cairngorm Extensions,especially for Modular Apps?

2008-04-11 Thread Jon Bradley

Good stuff indeed. Thanks for the links.

I've actually grabbed that stuff and started to look into it a bit  
deeper.


cheers,

jon


On Apr 11, 2008, at 4:29 PM, Douglas Knudsen wrote:


http://code.google.com/p/flexcairngorm/





DK







On Fri, Apr 11, 2008 at 3:28 PM, João Fernandes  
[EMAIL PROTECTED] wrote:

Jon,

regarding chain events, I use modular which allows this ( in fact  
thanks to Bjorn Schultheiss ). All you have to do is to have your  
events extend ChainEvent (which extends cairngormEvent ) and your  
commands extend SequenceCommand.







Re: [flexcoders] Re: Question about DisplayObject.hitTestPoint() and the shapeFlag

2008-04-07 Thread Jon Bradley


On Apr 4, 2008, at 5:54 PM, Eric Cooper wrote:

FWIW, I decided to write my own hit test using dot products for  
concave polygons. I will
need to do something a bit more involved for convex polygons, but I  
don't need that

immediately.


Give this a shot. This is from my AS3 boolean library I'm working on.  
I originally wrote the library for AS2 but recently decided to  
revisit it for a possible project.


- jon


/**
 *  Point inside polygon using winding number method
 *  q   Point2d A point 2d structure with x,y properties
 *  p   Polygon A polygon as an array of points in 
clockwise order
 *	returns	Boolean		Point is inside polygon if winding (w) number  
is != 0

 */
private function pointInsidePolygon(q:Point2d, p:Polygon):Boolean
{
var n:int = p.length;
var w:int = 0;

for (i=0; in; i++) {
var ip:int = (i+1)%n;
if ( ( p[i].y  q.y ) != ( p[ip].y  q.y ) ) {
if ( p[i].x = q.x ) {
if ( p[ip].x  q.x ) {
w += 2 * ( p[ip].y  p[i].y ) - 1;
}
else {
if ( ( (p[i].x-q.x)*(p[ip].y-q.y) -
 
(p[ip].x-q.x)*(p[i].y-q.y)  0 ) ==
 ( p[ip].y  p[i].y ) ) 
{
w += 2 * ( p[ip].y  p[i].y ) - 
1;
}
}
}
else {
if ( p[ip].x  q.x ) {
if ( ( (p[i].x-q.x)*(p[ip].y-q.y) -
 
(p[ip].x-q.x)*(p[i].y-q.y)  0 ) ==
 ( p[ip].y  p[i].y ) ) 
{
w += 2 * ( p[ip].y  p[i].y ) - 
1;
}
}
}
}
}
return (w!=0) ? true:false;
}




Re: [flexcoders] Re: Question about DisplayObject.hitTestPoint() and the shapeFlag

2008-04-07 Thread Jon Bradley


On Apr 7, 2008, at 8:46 AM, Jon Bradley wrote:


/**
 *  Point inside polygon using winding number method
 *  q   Point2d A point 2d structure with x,y properties
 *  p   Polygon A polygon as an array of points in 
clockwise order
 *	returns	Boolean		Point is inside polygon if winding (w) number  
is != 0

 */



Forgot to add that the parameter p for the polygon is a closed loop  
where p[0] == p[n].


cheers,

jon

Re: [flexcoders] Re: Question about DisplayObject.hitTestPoint() and the shapeFlag

2008-04-07 Thread Jon Bradley


On Apr 7, 2008, at 2:30 PM, Eric Cooper wrote:


w += 2 * (( p[ip].y  p[i].y ) ? 1 : 0) - 1;


Ah yup. I didn't compile that bit yet.

That was my reference code from the previous project and just copy/ 
pasted it with the change for function name and comments. I guess I  
shouldn't be surprised that didn't compile. :)


best,

jon

Re: [flexcoders] Where is adobe? Come to universities!

2008-04-03 Thread Jon Bradley


On Apr 3, 2008, at 11:58 PM, Sherif Abdou wrote:

Most Flash/Flex books do not even explain namespaces, how many  
bytes are int,uint and bitwise operations etc... I had to read a C+ 
+ book first to actually be able to use ActionScript. Also there  
needs to be scenarios of say when it is better to use a do while vs  
a for etc..


RTM. You don't need to read a C++ book to learn Actionscripts data  
types.


Matter of fact, doing C++ will screw you up if you want to learn AS.  
It's is a pretty annoying language, imho.


- jb



Re: [flexcoders] Cairngorm and Service Locators

2008-04-01 Thread Jon Bradley


On Apr 1, 2008, at 9:37 AM, Nicholas Watson wrote:


Within my ServiceLocator.mxml file, I have a listing of HTTPServices.
Each one of them has the URL hard coded in to the file. I would like
to make this a configurable setting, depending on which environment
the app is running off of (dev, testing, production). What is the best
way to accomplish this?



It depends on how modular you want it to be or how you want to  
configure it.


myService = ServiceLocator.getInstance().getService( loginService );
myService.url = pathToYourService;

I dynamically modified service details in some of my delegates this  
way to do exactly as you mentioned (dev,test,prod servers).


good luck,

jon



[flexcoders] WSDL Wizard Errors - Write over existing files?!

2008-03-26 Thread Jon Bradley
Anyone figure out a good solution for this?

I've got a service with about 8 separate WSDL files that I'm trying  
to generate automatically.

Unfortunately, most of them share types with each other so the WSDL  
wizard fails with a Filename Collision error. Shouldn't the Wizard  
be smart enough to figure out that the classes are defined once and  
re-used?

I guess I can export the classes to a separate directory and then  
merge the relevant ones back, but that's going to be a major pain.

Any suggestions?  I tried FlexTense as well, but it fails miserably  
on the WDSL files I've got which use a significant amount of binding  
and custom stuff.

thanks in advance,

jon


Re: [flexcoders] Re: Flex 3: Cloning WebService instance

2008-03-25 Thread Jon Bradley
Then have a blast trying to deal with WSDL security issues because  
you have to manually form the headers yourself, making the whole  
process quite painful.


I wish there were a better way to do it on OS X. There's a .NET  
application that can help if you're on Windows (http:// 
www.flextense.net/).


ugh.

jon

On Mar 25, 2008, at 11:25 AM, handitan wrote:


Cool!
I was being told by someone else about it too.
Will try it out.





Re: [flexcoders] Re: Need to determine allowScriptAccess/allowNetworkAccess at run time

2008-03-25 Thread Jon Bradley


On Mar 25, 2008, at 12:32 PM, shivkxr wrote:


 Try..catch around the ExternalInterface call?

 Tracy

That's the best that can be done?



Unless you have control over the HTML, yes that's the best you can do.

That's the point of this security by the way. SWF files cannot  
control the sandbox - it's not their place to do so. The HTML  
containing the SWF file is responsible for the security of the SWF  
file itself.


If SWF files could do anything like that running in the browser, it  
would be bad, very bad.


- jon

Re: [flexcoders] Re: Need to determine allowScriptAccess/allowNetworkAccess at run time

2008-03-25 Thread Jon Bradley


On Mar 25, 2008, at 2:45 PM, shivkxr wrote:


That's not what I meant. What I meant was there should be a
method/property available that provides this information


Ah. I misread your request then. Sorry about that!

- jb

[flexcoders] BlazeDS and Alfresco?

2008-03-24 Thread Jon Bradley
Has anyone gone down this road before?

I understand that Adobe Share is based on FDS and Alfresco (just  
recently found this out) and am embarking on a project where I'd like  
to integrate Flex data services (preferably BlazeDS) with Alfresco 2.9.

Any life experiences much appreciated. Matter of fact, any  
information on integrating Flex with Alfresco would be helpful.

thanks!

jon


Re: [flexcoders] FREE Component: New Styles for Panel, TitleWindow and Alert

2008-03-21 Thread Jon Bradley


On Mar 21, 2008, at 12:05 PM, Paul Whitelock wrote:


I've created a component that adds additional styles to a Panel,
TitleWindow or Alert and I'm making the component, source code and
documentation available for free under the MIT License.



May I be the first to say Fantastic!

Thanks for your useful, well polished contribution!

best,

jon

Re: [flexcoders] Re: Why are my embedded TrueType Fonts looking so horrible in Flex App

2008-03-13 Thread Jon Bradley


On Mar 13, 2008, at 3:46 PM, Blake Barrett wrote:


Todd,
We have seen this too, I filed a Jira ticket about this in the  
Adobe bug tracking system here:https://bugs.adobe.com/jira/browse/ 
SDK-14955?rc=1
If you have any additional comments or insight please comment on  
that ticket so we can provide Adobe with as much info as possible  
to get this resolved correctly.


This is not just a Flex font embedding bug. It's a global bug for all  
font handling in Flash and Flex.


The reason I notice it so much is that I'm building applications that  
allow dynamic scaling/rotation and editing of the text (compositing  
into some end format - PDF, image, etc.).


Every embed I've seen has a problem.

- jb

Re: [flexcoders] Re: Capturing and recording video with AIR

2008-03-05 Thread Jon Bradley


On Mar 5, 2008, at 12:23 PM, Abyss Knight wrote:


AIR can do it natively, check out the link I posted earlier or Google
for RichFLV. Some very slick apps already doing this.


AIR cannot compress and create FLV files 'natively'. RichFLV and the  
like are all using custom classes to write binary FLV data. The class  
posted earlier is the first I've seen that creates the proper headers/ 
etc - but doesn't perform any compression (FLV1/2).


That's a pretty good class for reference though.

There's no AS3 content that I know which will compress an FLV file.  
If anyone attempted to do that, they'd get into some interesting  
legal ramifications - Sorenson, On2 VP6 and H.264 are all formats  
that require licensing to generate.


cheers,

jon




Re: [flexcoders] Re: AlivePDF to create PDF on coldfusion Server

2008-02-22 Thread Jon Bradley


On Feb 21, 2008, at 3:36 PM, smustafa77 wrote:


Can u please provide with a sample,how can we convert to byte array
and store the PDF on the server



Hit up alivepdf.org and/or http://code.google.com/p/alivepdf/

Here's a tutorial:

http://alivepdf.bytearray.org/wp-content/tutorials/alivepdf-tutorial- 
flex-application.swf


The saving methods are all included within the Alive PDF library  
source. The saving methods were written quite well and allow you to  
save directly to a remote or file source (AIR).


The AlivePDF library comes with a create.php method that will take  
the resulting PDF stream and bounce it back to the client if you are  
using it online.
somePDF.savePDF(Method.REMOTE, pathto_create.php_method,  
Download.ATTACHMENT, somePDF.pdf);


Of course, you can use any server language you want. Just basically  
mimic the functionality in the create.php source.


The svn includes the create.php source, among other stuff.

I don't use AlivePDF with PHP personally. I use it with Django and  
DjangoAMF and use report-lab on the server to perform additional  
server-side work on the PDF files.


cheers,

jon



Re: [flexcoders] FileReference woes....

2008-02-22 Thread Jon Bradley


On Feb 22, 2008, at 12:56 PM, e_baggg wrote:


Using a packet sniffer, I see the jsessionID is not getting included
in the FF POST request. I have seen blogs to tack it on the parameter
request but that will not work for me (it has to be a header). This
had worked in the past so I am not sure what went wrong. I was on the
prerelease version of FB3 (pointing to 2.0.1 hotfix 3)...so i thought
it might be my Flash player. I reinstalled the Flash Players for IE
and FF from the main Adobe site and no luck. I tried building the swf
from FlexBuilder 2...no dice. Really at a loss here. Any thoughts from
anyone?



Man... what I'd be really interested in knowing is how in the world  
it worked in the first place. AFAIK, file uploads with session  
required have always been broken in FF - I don't know of any instance  
where it worked without passing the session details back to the server.


Was there a change in your upload code in JSP to require  
authentication? I found the error when our server was setup for  
authentication but the code accepting the file upload ignored the  
session details.


Open Bug (there may be others)

http://bugs.adobe.com/jira/browse/SDK-13196

good luck with it..

- j

Re: [flexcoders] Free Image Cropping Component

2008-02-20 Thread Jon Bradley


On Feb 20, 2008, at 1:06 PM, Paul Whitelock wrote:


Greetings!

I've just completed developing a component for Flex that enables an
image to be cropped.

A cropping rectangle is used to select the portion of the image to
retain. The cropping rectangle may be resized using four corner
handles and the rectangle may be repositioned by clicking inside of
the rectangle and dragging. The dimensions of the rectangle may be
unconstrained, or they may be constrained to an aspect ratio.



Good job on that.  Now all you need to do to make it complete is (in  
my opinion):


1. Incorporate Senocular's wonderful TransformTool class (also  
available from sepiroth.it for Flex)
2. Implement rotation of the crop tool while respecting the boundary  
of the original image


At least, that's what I've done in my own project. I can point you in  
the right direction if you need any pointers or assistance.


cheers and thanks for sharing!

- j

Re: [flexcoders] Adobe People, Save me from Silverlight! (Microsoft's Legal Record)

2008-02-13 Thread Jon Bradley


On Feb 12, 2008, at 8:28 PM, Robert Thompson wrote:

The thing developers need to be concerned about is Microsoft's  
history.


[big snip]

Honestly.

What Microsoft has done in it's history to people is irrelevant. You  
obviously care deeply, given your rough road and history with them.  
That's fine, but please don't taint these discussions that are quite  
targeted at the technical aspects of these two platforms.


Add something useful to the thread - like specific reasons why Flex,  
as a technology is a better investment for a business than  
Silverlight. I'm following the discussion because it's also something  
that's important to what I do. Having to sift through a bunch of  
historical garbage that's hella OT to the question at hand leaves a  
bad taste in my mouth.


- j



Re: [flexcoders] Adobe People, Save me from Silverlight! (Microsoft's Legal Record)

2008-02-13 Thread Jon Bradley


On Feb 13, 2008, at 9:28 AM, Tom Chiverton wrote:


Conduct in the past often informs future conduct.
Where a company has used a product as a weapon to bankrupt the  
competion, at
the expense of features, as MS has done in the past, it is hard to  
see how it
is not going to do so again i.e. make an effort with Silverlight up  
until
Flex is Netscape'ed at which point Silverlight will also be left to  
fester.

Witness IE, among other projects at MS.


Almost every software company is guilty of that in some manner or  
another. I get that all the time in the vfx industry - companies dead  
ending production software that is a key component to a pipeline.


In the end, it all boils down to money. In the case of Microsoft, eh,  
whatever. If the technology is good, clients demand it and it makes  
money, I use it.


It just so happens that the opportunities for monetization of  
creative and programming services are much greater with the Flex  
platform than they are with Silverlight.


- j

Re: [flexcoders] Flex Feedback for the Future

2008-02-11 Thread Jon Bradley


On Feb 11, 2008, at 1:48 PM, Samuel Neff wrote:

This is more of a player issue than Flex, but we need RTSP support  
for H264 video.  Locking us into FMS for streaming video is a real  
problem for us and means we can't use Flash video and will have to  
continue to use Quicktime until there is a solution.



Who knows if that will ever happen. Personally, I do not believe the  
player will allow for any additional streaming protocols for H.264  
anytime soon (just a guess, but I may be wrong). Consider that RTSP  
is also used by Microsoft and Real Media.


The H.264/AVC codec is a licensed format - including delivery of  
content encoded in this format. Although Flash Media Server will  
allow you to stream H.264 content, the licensing for distributing  
content on that platform is not covered when you purchase FMS.


Whether or not other companies (Wowza) also buck up licensing fees to  
stream this type of content is yet to be seen.


cheers,

- j

Re: [flexcoders] Image Marquee

2008-02-08 Thread Jon Bradley


On Feb 8, 2008, at 9:29 AM, Dan Vega wrote:

I am pretty new to Flex but a vet in the programming world so  
Action Script 3 is great and I think I am coming along quickly with  
it. I am trying to create a footer bar 800w 60h that will display  
an animated marquee of all the images i load from an xml file. I  
have about 30 images in there right now. I am using a tile list to  
display them and the way I have it the first 8 are showing up. Is  
there a way to animate the rest of the images  in a scrolling  
animation or am I completely on the wrong track here? Here is what  
I have so far, any help is greatly appreciated!



In this specific instance (if I read you right), you probably do not  
want to use a TileList. The TileList doesn't 'animate' in any simple  
fashion across all of the content in the list.


Your best bet if the number of items you are using is manageable (ie,  
not 200 or so), is to use a Repeater component with a custom item  
renderer. For the animation, I'd suggest running a timer to set the  
scroll position of the repeater.


You could also look into the TileCanvas at http://code.google.com/p/ 
jwopitz-lib/. The point being that both the repeater and Canvas  
components have smooth scrolling, whereas TileList does not (a point  
of contention a lot of people have had).


cheers,

jon

Re: [flexcoders] Re: Flex Interview Questions

2008-02-08 Thread Jon Bradley

On Feb 8, 2008, at 5:44 AM, Paul Andrews wrote:

Oops, just failed the interview - what I meant to say was that I  
have to
explicitly call a setter/getter function in Java, while AS3 allows  
me to

access my setters and getters as though they are variables..  Phew..


Nah, you didn't fail. Knowledge of Java is irrelevant to Flex and AS3  
development.


- jon



Re: [flexcoders] Looking for offical specs on OpenGL hardware acceleration

2008-02-05 Thread Jon Bradley


On Feb 4, 2008, at 6:05 PM, cole_joplin wrote:


Is there an official spec on this somewhere? I'd like to know if FP
has just a narrow window for me to use, or if I have a way to get to
more OpenGL calls. Will OpenGL become available outside of fullscreen
mode?


Literally a narrow window - ie, you have no window, it's nothing you  
can control aside from opening up into fullscreen based on a  
rectangular region. As of this time, it's only for blitting the  
screen rect to a larger window - and only for the reason of  
accelerating video playback from my understanding.



What does Adobe officially support now and what is Adobe
developing for Astro?


Just the fullscreen mode. If you want to know all you can about any  
hardware acceleration, or any player advances, your first step should  
be Tinic's blog:


http://www.kaourantin.net/


Are there any AIR apps that have done MP4 720p or 1080p?


I'm doing one now actually. The usefulness of such an AIR application  
at 1080 is pretty minimal considering barely no body has a monitor  
that can display that resolution.720 looks great though.


cheers,

jon

Re: [flexcoders] Flash video switcher to video file..

2008-01-31 Thread Jon Bradley


On Jan 31, 2008, at 11:24 AM, grimmwerks wrote:


I've got a client asking me if it's possible to create a sort of video
switcher -- where users choose shots - and then export to a file.

I think something like this is possible in Flash Media Server, but
unsure?



There was another response to this, but I think that was more geared  
toward services - the Premier Express and Brightcode Aftermix. Those  
are online editors that user the server for all video encoding work.  
Sure, there's interactive previews of things and whatnot, but no  
encoding or 'saving to file' going on in those interfaces.


The only actual FLV editor that really can save a new FLV file out is  
the FLV editor at richapps.de. Even then, it's segmenting the  
elements and using originally encoded footage - so no re-encoding is  
going on. You could technically write an FLV encoder in AS3 but it  
would be so horribly slow.


FMS can stream from in-out points of multiple video files, but you're  
not going to get any transitions or other stuff going on.


- jon

Re: [flexcoders] Flash video switcher to video file..

2008-01-31 Thread Jon Bradley


On Jan 31, 2008, at 3:13 PM, P Smith wrote:

 The only actual FLV editor that really can save a new FLV file  
out is the FLV editor at richapps.de.


could the fms serverside actionscript method Stream.record() be  
used to generate new flv?
http://www.adobe.com/livedocs/flashmediaserver/3.0/hpdocs/ 
0396.html#116659



I'm under the impression that Stream.record is for server-side usage  
to combine/merge separate streams of data or for recording from a  
camera or other input source.


Also, stream.record takes a long long time. Merging two sources for  
example, takes at minimum as long as the two original resources are  
in duration (ie, doesn't work from in/out points on separate  
streams). That's not from personal experience though, just from what  
I've read about it.


Of course, i might be completely wrong about this. I haven't checked  
out the new FMS Interactive edition yet, so there may be other  
options available now.


cheers,

jon



Re: [flexcoders] Re: Error #2025 - Clash between Flex 3 (Beta 2) Flash CS3 (Possible Bug)

2008-01-31 Thread Jon Bradley


On Jan 31, 2008, at 3:20 PM, Justin Winter wrote:


Maybe I'm looking at this wrong, but I'd love to hear a better way to
overcome the traditional workflow changes since Flex 2.

Best regards.
Justin Winter
useflexmore.com


Sander a QI recently released some code that demonstrated the  
capability of utilizing the Flex framework (v2 sdk) within the Flash  
CS3 IDE. It was mainly to utilize Cairngorm, but apparently you can  
use any Flex UI control as well - with styling (including CSS). It  
just requires some AS3 coding to initialize the proper style  
parameters for each control.


http://labs.qi-ideas.com/2007/12/25/using-flex-compiled-code-within- 
flash



- jon

Re: [flexcoders] Picnik photo functions/features RD

2008-01-29 Thread Jon Bradley
I believe a majority of the image processing is done on the server  
but it depends on the circumstance. In most cases (not all though),  
doing image processing in AS is not the best design choice.


Some transformations may be done in AS, but it would not make sense  
in the general case to do so. Especially with complex transformations  
that may require per-pixel operations - AS is exceedingly slow at that.


In my experience it's faster to push a quick image transformation  
matrix or color matrix (or other image edit) to the server and have  
GDI++, ImageMagik, PIL or one of the many imaging libraries make the  
modification and send back a proxy.


peace,

jon

On Jan 29, 2008, at 7:14 PM, Alexander Tsoukias wrote:


Hi all,

Picnik.com has all these photo effects and I was wondering how are
they doing it. Is it built in actionscript as functions?

Are they using third party components?

Any input is greatly appreciated.

PS. Anyone looking to work on this please contact me.

Thank you,
Alex




Re: [flexcoders] Re: Picnik photo functions/features RD

2008-01-29 Thread Jon Bradley


On Jan 29, 2008, at 10:27 PM, Alexander Tsoukias wrote:


Given the nature of picnik, i wouldnt think they go back and forth as
the manipulation happens instantly as you drag a slider or pick a  
color.


I think that's accurate. Some of the simpler operations are able to  
be done in Flash because of the color matrix filter.



You might be right about final processing (compiling) of the final
image, but possibly giving the user a preview of how the image will
look without going back and forth to the server for processing.


It does depend on usage. For high resolution photo editing - and  
relatively accurate color work, it's best to do that outside of AS.  
Things like a 'filmic' sepia conversion isn't possible with a simple  
transformation that Flash can handle (not without per-pixel  
operations that is).


That said, with Hydra and the new advancements Adobe is making to get  
Photoshop online marketable, I think we'll be seeing some pretty nice  
capabilities in the Player in the near future.


good luck on your project if you're heading down that road. :)

cheers,

jon

Re: [flexcoders] Role based rendoring of MXML components - visibility and editability

2008-01-28 Thread Jon Bradley


On Jan 28, 2008, at 12:09 PM, Abdul Qabiz wrote:

I would not do any such role-based things on client, it's very easy  
to spoof http packets and a normal user can get access to Admin UI...


Just be careful with that... If you have solid way to avoid any  
such security issues, go ahead.


-abdul



Well ... that'd only be the case if the developer was so out-of-touch  
with security as to not use authentication on the server to actually  
allow the user to perform administrative requests.


Personally, I use modules loaded in for various authenticated  
operations. Those modules are only available through a servlet that  
verifies the user and session. Only then will the modules be allowed  
to get sent to the client.


Additionally, the paths that are used (aside from authentication) are  
dynamically sent to the client and not embedded in the client side  
application. This adds an additional level of 'security.'


cheers,

jon

Re: [flexcoders] Font rendering for print

2008-01-09 Thread Jon Bradley


On Jan 9, 2008, at 8:35 AM, Frederico Garcia wrote:

Does anyone know how to make flash render fonts the same way for  
screen
display and printing? I've tried embedding fonts, changing the  
settings

for flashType and fontAntiAliasType but I just can't get fonts to
display the same way. This is causing a lot of trouble since I can'  
get

lineMetrics to give me accurate values.


Good luck. Long response follows.

Flash renders the line height of all text with an incorrect (always)  
leading value. This is major apparent as you change the font size of  
the text in the field.


If you set the leading of a text field, that leading is not used for  
all point sizes of text. I can only surmise that's because the  
developers failed to use just the point size of the type to set  
default leading value.


The line height issue is not a bug - it's just straight up wrong.

First the problems you will run into:

1. Leading of text is never right - the line heights vary within one  
field (?!). It adds in some weird ass measure including the ascent  
and descent (which varies as well).


2. Changing the font size and setting the leading to the same value  
will lead you to madness. The leading of the field will change at  
certain point sizes (sometimes more than 30% larger/smaller) - even  
if you force a certain leading.


3. If you scale your text field, your character spacing AND  
individual character baselines shift - they are not all aligned on  
the same baseline. Imagine a word where groupings of the characters  
are shifted down 4-5 pixels (again, [EMAIL PROTECTED]). If the text field is  
rotated 0.01 radians, the character spacing issue is fixed but the  
baseline issue is not (wtf).


#1 and #2 can be fixed. #3 is a bug in the font rendering in Flash. I  
do not know how to fix this issue completely. Big prize to whoever  
can figure that out.


Now, to fix #1 and #2 and match the way Photoshop renders line heights:

Photoshop renders text with a leading of 120% of the FONT SIZE. It  
uses the max ascent and descent of the entire font outline with that  
leading - rather than a dynamically adjusted ascent and descent,  
which is what the player does.


This process will render a text field almost identically to Photoshop:

1. Get the line metrics from every line of text
2. Find the average line height (fun)
3. Get the difference between what Flash, in it's confused mind,  
thinks the leading should be and what you want it to be (== font size  
*1.2)
4. Set the leading of a new text format object to this resulting  
number minus the ascent and descent measurements of the text format  
in question.


This whole thing has annoyed me for years. What is driving me crazy  
right now is the #3 problem I listed above (using embedded fonts).


cheers,

jon



[flexcoders] Bug in TextInput with select and release outside

2007-12-30 Thread Jon Bradley
Has anyone run into this and know what the fix might be?

This is tough to explain in a short description:

1. Have some text in a text input field.
2. Select the text from right to left (all of it), releasing outside  
of the text input
3. Delete it
4. Start typing
5. Notice that the text stay at 1 character (or 2 if you type fast)  
and overwrites the current content each time you type.

It's basically as if the selection of the text remains and is not  
reset after you delete the text in the input field.

Wracking my brain trying to figure out this one. I gather it's  
something messed up with the Selection of the text in the field not  
being reset properly on the delete. It should be no selection with  
current position at 0.

I hope there's any easy fix to this one...

thanks,

jon


Re: [flexcoders] TransformTool

2007-12-14 Thread Jon Bradley


On Dec 14, 2007, at 7:43 AM, dopenhagen wrote:


I am looking for the best way to apply transformation capabilities to
an object.

I have so far been using the TransformTool from Senocular
(http://www.senocular.com/demo/TransformToolAS3/TransformTool.html)
but it seems to me that many other Flex applications are using some
other standardized way.

What is the default way to implement this feature ?



There is no default way. It's just a transformation matrix in the  
end, no matter which tool you use. If you want it interactive, the  
Senocular version is the best IMHO.


Here's the Flex modification of the Senocular classes:

http://www.sephiroth.it/weblog/archives/2007/07/ 
transformtool_modification.php


Alessandro - who modified this to begin with - now works for Aviary a  
good bit (not sure if it's full time though). :) This class is also  
used in Fauxto, possibly Premier Express Flex and quite a few other  
initiatives.



cheers,

jon




Re: [flexcoders] Re: TransformTool

2007-12-14 Thread Jon Bradley


On Dec 14, 2007, at 10:58 AM, dopenhagen wrote:


Hello Jon,

Thanks for your reply.
I had also found the Alessandro posting and found it to be quite
valuable. However, despite his codesnippet, I am still having trouble
skinning the control-handles of the TransformTool-Control.



You have a few ways to do it. Either you embed the graphic asset into  
the control class itself (say, TransformToolScaleControl), or you set  
the skin at runtime. Check out the setSkin method of the  
TransformTool class:


public function setSkin(controlName:String, 
skin:DisplayObject):void {
			var control:TransformToolInternalControl = getControlByName 
(controlName);

if (control) {
control.skin = skin;
}
}

The controls extend TransformToolInternalControl - that's another  
place you can look. TransformToolInternalControl has a public set  
skin property - pass it a display object.


For sake of argument

[Embed(source=/assets/newScaleControlImage.png)]
public var img:Class;
public var scaleCtrl:BitmapAsset

scaleCtrl = BitmapAsset( new img() );

transformToolInstance.setSkin( scaleTopLeftControl, scaleCtrl);
transformToolInstance.setSkin( scaleTopControl, scaleCtrl);
transformToolInstance.setSkin( scaleTopRightControl, scaleCtrl);
transformToolInstance.setSkin( scaleRightControl, scaleCtrl);
transformToolInstance.setSkin( scaleBottomRightControl, scaleCtrl);
transformToolInstance.setSkin( scaleBottomControl, scaleCtrl);
transformToolInstance.setSkin( scaleBottomLeftControl, scaleCtrl);
transformToolInstance.setSkin( scaleLeftControl, scaleCtrl);

Now, no guarantees this code will function right. I just typed it up  
right here quickly without testing anything.


good luck.

- jon

Re: [flexcoders] cut a piece of gif or jpg image

2007-12-13 Thread Jon Bradley


On Dec 13, 2007, at 9:46 AM, ds.dinesh wrote:


Please send me any flex code which help me to cut a piece of image.


That's not specific to Flex. That's just the BitmapData API.

Look up BitmapData in the AS3 docs.

- j

[flexcoders] Alfresco anyone?

2007-12-11 Thread Jon Bradley
Has anyone here had either success or is experimenting with Flex and  
Alfresco?

I'm not a fluent Java developer by any means and there's nothing I  
can find whatsoever about Flex/Alfresco integration. There's mention  
of it here and there and how Adobe and Alfresco are working together  
(fruits of that labor yet to be discovered).

thanks for any info you've got.

- jon


Re: [flexcoders] Issues with Dynamic vs. Embedded Font Leading

2007-12-01 Thread Jon Bradley
So, yea. There is a bug in the line space rendering in Flash for  
embedded fonts.


Easiest test case is to build a TextField display and set the leading  
to the point size of the font, minus the ascent and descent. In the  
ideal world, this should cause all lines of a multiline text field to  
align on the baseline of the first line (overlap). Unfortunately,  
this does not occur at all point sizes - only a few: 9,12,26,32 and a  
couple others I think.


For all  other point sizes, the line spacing determined by Flash is  
off anywhere from half a point to 10 points. That's pretty wack if  
you ask me. I might need to file a bug on the text rendering  
sometime. First I have to figure out why it's doing that (I have a  
fix that works). The wonderful getTextExtent inaccuracies didn't help  
much either.


It's interesting to set the line spacing and see it fluctuate as the  
font sizes change.


Whatever. Hackery abounds. At least I can get it to match Photoshop's  
rendering of text now, minus display issues with antialiasing and the  
way the Saffron engine renders characters. But that is another,  
separate issue - it doesn't render all characters right - that might  
be because of the quadratic approximation of the font outlines.


cheers,

jon


On Nov 29, 2007, at 8:33 PM, Jon Bradley wrote:


Embedded fonts, on the other hand, incorrectly render leading,
always. I say incorrectly because it's not how any other desktop
print application does it, so far as I can tell. Maybe it's an issue
with the way saffron was designed .. how is Flash calculating this?

Flash is definitely not rendering line spacing/leading correctly, but
I cannot figure out what it is doing to calculate this. If I can get
that taken care of, I have the rest of the situation solved
(tracking, margins, etc.), matching photoshop as my baseline.




[flexcoders] Issues with Dynamic vs. Embedded Font Leading

2007-11-29 Thread Jon Bradley
This might've been brought up before, but I can't find reference to it.

I'm working on an application that is rendering text fields  
(multiline, print resolution) on the client end that will be rendered  
on the server, currently using GDI+ (but other options are open).

Photoshop, InDesign and Quark are my baselines. They all handle and  
deal with font leading identically for all fonts that I've tested,  
barring any slight shifts due to antialiasing.

Flash on the other hand yikes. By using some simple trickery,  
font leading on device fonts can mimic identically, to the pixel  
almost, any leading in the above 3 stated applications.

Embedded fonts, on the other hand, incorrectly render leading,  
always. I say incorrectly because it's not how any other desktop  
print application does it, so far as I can tell. Maybe it's an issue  
with the way saffron was designed .. how is Flash calculating this?

Flash is definitely not rendering line spacing/leading correctly, but  
I cannot figure out what it is doing to calculate this. If I can get  
that taken care of, I have the rest of the situation solved  
(tracking, margins, etc.), matching photoshop as my baseline.

Anyone in the know about this?

thanks in advance,

- jon


Re: [flexcoders] Canvas layout / style

2007-11-14 Thread Jon Bradley


On Nov 14, 2007, at 10:51 AM, Giles Roadnight wrote:


The obvious way to do it is to have an image as a background with
rounded corners and shadows as part of the image, I'd rather do it
with styles if I could though.


Might not be exactly what you are looking for, but could you just use  
a rounded corner mask?


Shadows and whatnot will apply to the container canvas no problem  
with the masking.


good luck,

jon



Re: [flexcoders] Maximum Image Width able to be displayed

2007-11-02 Thread Jon Bradley


On Nov 2, 2007, at 3:11 AM, greggiacovelli wrote:


Hi,
I have been trying to figure out a way around this for a few weeks. It
seems there is an undocumented limit of around 8192 px wide images
that can be rendered inside of the flash player. Is this an
undocumented limitation or is there a way to get around it?


I believe that is correct. I think the maximum addressable space in  
Flex is around that number. Someone from Adobe may be able to confirm/ 
debunk that ...


I assume you're loading a bitmap smaller than that then scaling it  
up? Didn't think you could load a bitmap larger than 2880.


cheers,

jon




Re: [flexcoders] Maximum Image Width able to be displayed

2007-11-02 Thread Jon Bradley


On Nov 2, 2007, at 12:30 PM, Greg Giacovelli wrote:

So what it seems is going on is that it renders the image, clips  
it, and then displays the visible region and applies a mask over  
the rest. However the render fails so the rest of the steps are  
just wasted cycles. I have a fix to just chop the image in half  
prior to loading it. But since I am not the only one with this  
problem, I was wondering if there are known strategies I don't know  
of to get around this feature.



Create a rectangle and move that using any of your available tween  
libraries. Use the rectangle to copy pixels from the virtual 'region'  
that the rectangle represents on the original image into a new Bitmap  
that represents the visible area.


cheers,

jon

Re: [flexcoders] Aha... did someone say C/C++ to AS3???

2007-11-02 Thread Jon Bradley

On Nov 2, 2007, at 12:30 PM, Aldo Bucchi wrote:

It is THE biggest thing I have seen so far related to the flash  
player.


It's cool, no doubt.

There are questionable elements to that demonstration. Although it  
was primarily running in the Player, it's likely that the actual  
rendering was done using low-level within a modified version of the  
Player. An interpreted language is just not fast enough, and there is  
no way the current Player version couldn't approach a 30fps playback  
speed with the graphics of Quake.


Something has to give somewhere. Details are not plentiful enough to  
fully evaluate the approach.



- is this real?


To some extent, it sure is. Pre-processing C into other languages has  
been around a long time. This is the first time a lot of people have  
seen this approach because they don't come from a traditional  
software dev. background.



- when should we expect this to hit the street, if ever ( we need to
get prepared ya know... )


It's RD tech. I don't think this is to be expected anytime soon, but  
I could be wrong about that.



- hmm what happens with licenses... can we just port EVERY open source
c/cpp interpreter, codec, lib, etc to as3?


Licenses? This is kinda moot. It's the possibility of porting C to  
AS3, not whether or not it's legal. Could you port over mp3 codecs?  
Sure you probably could, but you'd have to pay dearly.



damn. this is one of those things that make me question everything
about everything. It just changes the rules of the game completely. It
is too good to be true, and at the same time too bad... i'm confused.


Remove the coolness factor for one moment of being able to see Quake  
run in the Flash Player. Then wonder how modified that Player version  
was...


Quake is available open source. Why in the world would you want to  
put it in AS3 – aside from absolute coolness factor? We have to  
remember target audiences here.


Gamers expect cool ass graphics and high framerates. Even with  
hardware acceleration, you can't fine tune memory management and eek  
out as many CPU cycles as you can to get the best playback. Try  
getting the PhysX libraries to run at a decent rate in an interpreted  
language


To me, it means more libraries are available for use to AS3 (or 4)  
developers. Those libraries are already there and we can already use  
them. We just have to port it by hand. Just like the PNG and JPG  
encoder were ported by Tinic. Took a bit of thinking I'm sure, but it  
works.


The absolutely cool factor is the amazing speed at which they  
demonstrated code being ported over, questions about implementation  
notwithstanding.


The technology is highly cool, no doubt. I'd just keep focus on what  
it really means at this present time - a faster way to get more code  
into Flash.


Heck, I'm excited because I might be able to resurrect some pretty  
complex projects – complex for me, 8 or so years ago – that were  
built in Codewarrior. :)


cheers,

jon



Re: [flexcoders] Aha... did someone say C/C++ to AS3???

2007-11-02 Thread Jon Bradley


On Nov 2, 2007, at 4:27 PM, Matt Chotin wrote:

The demo was on a custom Flash Player but my understanding of the  
only real change is that he made some performance improvements in  
our ByteArray class (that we can hopefully incorporate into a  
future release).  As part of the demo I believe the sound was not  
actually coming out of the Player, but the graphics all were.


If the only change was to the ByteArray class then all I have to say  
is ...


... damn.

Now all that remains if for you guys to post up that converted AS3  
code for peer review. Quake is open source ya know ... :o)


- jon

Re: [flexcoders] Aha... did someone say C/C++ to AS3???

2007-11-02 Thread Jon Bradley

Basically, it is now business to create a library and become the first
to have it in AS3... probably not an evident niche to the rest of us
because AIR has not hit the streets yet, but I can bet more than one
company is doing something in those lines.


Everyday individuals and companies are porting libraries to the Flash  
platform that existed in other languages – those that were ported to  
other languages before it. I don't think this is any revelation. The  
capabilities of the Flash platform have expanded to make this  
possible. A c/cpp to AS processor doesn't change the situation.


The real differentiator in our world is the Player, not the language.


Of course you might argue that the flex framework is unparalleled with
binding, repeaters, events, effects, etc. ... but isn't it opensource
already?


But it took thousand and thousands of man-hours and a significant  
amount of people to develop the framework and to support it. I  
challenge anyone to attempt to do the same. If there is a business  
case to be made for another tool that can match the capabilities of  
the Flex framework, then by all means. Have fun writing 200k of  
relatively bug-free code. :)



And what about LCS??


It's supported, it's backed by the thought leaders on the technology.  
Sure, a team of very smart developers could put together a similar  
offering, but they sure couldn't support it the same and they would  
always be playing catch-up to those that are developing the  
technology in the first place.


Adobe is the thought leader and the first adopter.


If part of the player is OS ( correct me is im wrong ), the framework
is OS, and now we can port code and run it in Flash... what's left for
Adobe to profit from? Perhaps acrobat...? or Media Server? ( oh.. red5
).


The Player is not open source. It's a closed, licensed model. Another  
very important point is that, from my understanding, it's against all  
EULAs to write your own Player - write a public SWF runtime and  
they'll sue you. :) It's a closed market and it's highly unlikely to  
change soon.



To a certain degree, Adobe might be shooting themselves in the foot
with this one.


I don't think they are really. Adobe is a huge company. They control  
the Player, which is a necessary evil now they've gotten this far  
with the technology.


The Flex line of products is a very small portion of Adobe's revenue.  
The Flash IDE is way more ingrained in the market than a niche tool  
like Flex.


Their real focus on this stuff is the entire enterprise process and  
workflow. Their analyst meeting documents are always a great read and  
give some pretty good insight into where they are positioned. Stuff  
like that Quake technology demo are to keep us happy, imho (and they  
did a dang good job!), but It's miniscule in the grand scheme of what  
Adobe does.


In the end, it's a code converter. Anyone outside of Adobe could've  
done it - they just did it first. Glad they're still the thought  
leaders.


cheers,

jon




Re: [flexcoders] Re: Will Papervision 3D be available for use in Flex Builder 3 ???

2007-11-01 Thread Jon Bradley

On Nov 1, 2007, at 12:00 PM, Paul Andrews wrote:

Actually, it's a pretty big deal on reflection. I remember that we  
will also
have a Z axis, so it's possible to represent any 3D surface and  
therefore
full-blown 3D objects. I wonder how they render now that they  
have a Z

axis to contend with...


Four corner distortions that are driven by lower-level code I believe  
(ie, not intrinsic AS).


It's a big deal to designers mostly and will definitely be cause for  
a new wave of 3d engines popping up.


For programmers, hopefully they throw us a bone and at least do this  
implementation right - at a minimum real 3x3 and 4x4 matrices. That  
may be asking too much though since that whole 5kb of compressed code  
will totally bloat the player.


cheers,

j



  1   2   >