You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Martin Heidegger <mh...@leichtgewicht.at> on 2012/02/26 23:18:16 UTC

[RT] DPI dependent code was. Flex: New user interface design

I am all for it. I have implemented that for JavaScript before. My 
problem with the javascript implementation is to make it "easy". In 
other words: Without a "id" it is not possible to implement a generic 
ID. I have started with a implementation of JavaScript Modules but 
haven't had time to finish back then [1].

yours
Martin.

[1] 
http://www.assembla.com/code/nanosome/subversion/nodes/trunk/as3/integrate/src/nanosome/integrate/browser?rev=278

On 27/02/2012 07:05, Omar Gonzalez wrote:
> On Sun, Feb 26, 2012 at 1:59 PM, Martin Heidegger<mh...@leichtgewicht.at>wrote:
>
>> Hello Erik,
>>
>> real world units are no problem in css/javascript allowing "cm". In Flex
>> the problem is that the Flash Player does not offer proper DPI (as you
>> mentioned). That means we need "workarounds" it can be implemented within
>> the Web using ExternalInterface - a JavaScript bridge.
>
> So this part should be easy as we can just store a JS string and execute it
> with EI and wrap that all in a class that we can use in UI components to do
> the appropriate width/height assignments. I don't think that would be a big
> deal, we should be able to just poll for that value from the browser once
> in Flex browser based apps.
>
>
>> It can be implemented in AIR using NativeExtensions. There is just no
>> standard solution for that available in Flex.....
>
> If we wrote an ANE that covered all the OSs we need to cover we could apply
> it as a behavior as we've discussed in other threads giving a component the
> capability of reading its correct width and height values in Flex based AIR
> applications. I think that would be a nice feature. Its not going to create
> UIs that are universal to all types of screen sizes from a single layout,
> but it'll make applying designs more predictable and hopefully much more
> accurate. I think its something worth investigating.
>
> --
> Omar Gonzalez
> s9tpepper@apache.org
> Apache Flex PPMC Member
>


Re: [RT] DPI dependent code was. Flex: New user interface design

Posted by Martin Heidegger <mh...@leichtgewicht.at>.
Yeah, completely experimental code.

It does following things:

  * It replaces the embed codes in the html without id and with the same 
url as the swf that is running to
     embed codes with a proper id
  * It allows to create "JavaScript" code that receives directly a 
reference to the embed code it comes from
      (important if you have more than one Flash running on the same page)
  * It automatically takes care of error handling

yours
Martin.

On 27/02/2012 07:28, Omar Gonzalez wrote:
> What is your script trying to do exactly? I see it handling divs and
> rewriting the Flash div for some reason? I'm not really sure what the .as
> and .js file are working to do together. I guess I might have misunderstood
> what you wanted to do with the JS bridge you originally mentioned to Erik.
> Do the browsers give a more accurate value for the dpi? I haven't tried
> querying for that value in any projects yet.
>
> --
> Omar Gonzalez
> s9tpepper@apache.org
> Apache Flex PPMC Member
>


Re: [RT] DPI dependent code was. Flex: New user interface design

Posted by Omar Gonzalez <om...@gmail.com>.
On Sun, Feb 26, 2012 at 2:18 PM, Martin Heidegger <mh...@leichtgewicht.at>wrote:

> I am all for it. I have implemented that for JavaScript before. My problem
> with the javascript implementation is to make it "easy". In other words:
> Without a "id" it is not possible to implement a generic ID. I have started
> with a implementation of JavaScript Modules but haven't had time to finish
> back then [1].
>
> yours
> Martin.
>
> [1] http://www.assembla.com/code/**nanosome/subversion/nodes/**
> trunk/as3/integrate/src/**nanosome/integrate/browser?**rev=278<http://www.assembla.com/code/nanosome/subversion/nodes/trunk/as3/integrate/src/nanosome/integrate/browser?rev=278>
>
>
What is your script trying to do exactly? I see it handling divs and
rewriting the Flash div for some reason? I'm not really sure what the .as
and .js file are working to do together. I guess I might have misunderstood
what you wanted to do with the JS bridge you originally mentioned to Erik.
Do the browsers give a more accurate value for the dpi? I haven't tried
querying for that value in any projects yet.

--
Omar Gonzalez
s9tpepper@apache.org
Apache Flex PPMC Member