Scout - What does this mean?

classic Classic list List threaded Threaded
54 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Scout - What does this mean?

bilbosax
The big question is do Exceptions take up time?

I am finally able to get some good data into Scout to profile my mobile application, and I am quite confused.  The compiler finds no errors, debugging throws no errors, my application is displaying all of the correct data, but when I run Scout and look at a frame that is taking nearly 4000ms, I find that hundreds of exceptions are being thrown.  They don't show that they are taking any time in ms, but surely hundreds of them have to be taking up some significant time.  They are all TypeError Exceptions.  I assume that they mean that I assigning an incorrect value to a datatype of some sort.  Here is a picture of a grab of the error list:



If I mouse over any of the exceptions, it gives me a ton of data that I don't really understand.  It does not give you a line-number of where the exception is being thrown, so I don't know exactly what variable is being cast wrong.  If anybody could take a look at this and help me narrow down a value that I am assigning incorrectly, I would greatly appreciate it.  I am assuming that it is an itemrenderer value that I use "data" to assign values to labels. Do you think  that hundreds of these exceptions are taking any appreciable amount of time?

Exception: TypeError
MethodInfo-12677
mx.binding::Binding/wrapFunctionCall
mx.binding::Binding/innerExecute
mx.binding::Binding/wrapFunctionCall
mx.binding::Binding/execute
mx.binding::BindingManager$/executeBindings
renderers::targetListRenderer/_targetListRenderer_Label3_i
renderers::targetListRenderer/_targetListRenderer_Group5_i
renderers::targetListRenderer/_targetListRenderer_HGroup2_c
renderers::targetListRenderer/_targetListRenderer_Group4_c
renderers::targetListRenderer/_targetListRenderer_HGroup1_c
renderers::targetListRenderer
mx.core::ClassFactory/newInstance
spark.components::DataGroup/createRenderer
spark.components::DataGroup/createVirtualRendererForItem
spark.components::DataGroup/getVirtualElementAt
spark.layouts::VerticalLayout/updateDisplayListVirtual
spark.layouts::VerticalLayout/updateDisplayList
spark.components.supportClasses::GroupBase/updateDisplayList
spark.components::DataGroup/updateDisplayList
mx.core::UIComponent/validateDisplayList
mx.managers::LayoutManager/validateDisplayList
mx.managers::LayoutManager/doPhasedInstantiation
mx.managers::LayoutManager/validateNow
mx.core::UIComponent/commitCurrentState
mx.core::UIComponent/setCurrentState
mx.core::UIComponent/set currentState
views::RealDealsTabletRealDealsMainView/compClickedHandler
flash.events::EventDispatcher/dispatchEvent
mx.core::UIComponent/dispatchEvent
views::RealDealsTabletRealDealsMainViewInnerClass0/myEventDispatcher
views::RealDealsTabletRealDealsMainViewInnerClass0/___RealDealsTabletRealDealsMainViewInnerClass0_Button1_click
       
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

clintm
Inline below

On Tue, Nov 15, 2016 at 12:43 PM, bilbosax <[hidden email]> wrote:

> The big question is do Exceptions take up time?
>

Yes.


>
> I am finally able to get some good data into Scout to profile my mobile
> application, and I am quite confused.  The compiler finds no errors,
> debugging throws no errors, my application is displaying all of the correct
> data, but when I run Scout and look at a frame that is taking nearly
> 4000ms,
> I find that hundreds of exceptions are being thrown.  They don't show that
> they are taking any time in ms, but surely hundreds of them have to be
> taking up some significant time.  They are all TypeError Exceptions.  I
> assume that they mean that I assigning an incorrect value to a datatype of
> some sort.  Here is a picture of a grab of the error list:
>
> <http://apache-flex-users.2333346.n4.nabble.com/file/n14126/scout2.jpg>
>
> If I mouse over any of the exceptions, it gives me a ton of data that I
> don't really understand.  It does not give you a line-number of where the
> exception is being thrown, so I don't know exactly what variable is being
> cast wrong.  If anybody could take a look at this and help me narrow down a
> value that I am assigning incorrectly, I would greatly appreciate it.  I am
> assuming that it is an itemrenderer value that I use "data" to assign
> values
> to labels. Do you think  that hundreds of these exceptions are taking any
> appreciable amount of time?
>
> Exception: TypeError
> MethodInfo-12677
> mx.binding::Binding/wrapFunctionCall
> mx.binding::Binding/innerExecute
> mx.binding::Binding/wrapFunctionCall
> mx.binding::Binding/execute
> mx.binding::BindingManager$/executeBindings
> renderers::targetListRenderer/_targetListRenderer_Label3_i
> renderers::targetListRenderer/_targetListRenderer_Group5_i
> renderers::targetListRenderer/_targetListRenderer_HGroup2_c
> renderers::targetListRenderer/_targetListRenderer_Group4_c
> renderers::targetListRenderer/_targetListRenderer_HGroup1_c
> renderers::targetListRenderer
> mx.core::ClassFactory/newInstance
> spark.components::DataGroup/createRenderer
> spark.components::DataGroup/createVirtualRendererForItem
> spark.components::DataGroup/getVirtualElementAt
> spark.layouts::VerticalLayout/updateDisplayListVirtual
> spark.layouts::VerticalLayout/updateDisplayList
> spark.components.supportClasses::GroupBase/updateDisplayList
> spark.components::DataGroup/updateDisplayList
> mx.core::UIComponent/validateDisplayList
> mx.managers::LayoutManager/validateDisplayList
> mx.managers::LayoutManager/doPhasedInstantiation
> mx.managers::LayoutManager/validateNow
> mx.core::UIComponent/commitCurrentState
> mx.core::UIComponent/setCurrentState
> mx.core::UIComponent/set currentState
> views::RealDealsTabletRealDealsMainView/compClickedHandler
> flash.events::EventDispatcher/dispatchEvent
> mx.core::UIComponent/dispatchEvent
> views::RealDealsTabletRealDealsMainViewInnerClass0/myEventDispatcher
> views::RealDealsTabletRealDealsMainViewInnerClass0/___
> RealDealsTabletRealDealsMainViewInnerClass0_Button1_click
>
>
>
It could be a null pointer 1009. The data property can be set to null
especially when using binding.

Here's a util to debug bindings.
https://github.com/vectorscape/monet/blob/b0ea9d8eec7a8800853e49ac924bb171f72175d9/flex/src/com/velti/monet/utils/BindingDebugger.as

You may want to avoid using mxml for itemRenderers and also avoid using
bindings inside the item renderers all together.


>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Scout-What-does-this-mean-tp14126.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
Thanks for the reply Clint. I am impressed that you you were somehow able to tell that I am using an mxml renderer with binding. I will start by trying to debug this and then I may ATTEMPT to write an actionscript itemrenderer, but I have little idea how to start. I know I will have to override a lot of methods because I have hgroups, many groups, tons of labels, and some radio buttons in my renderer. I will try to use the class you have included and report back. Thanks for pointing me in a direction to start.
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
In reply to this post by clintm
No luck so far.  I have a component that slides onto the screen when a button is clicked that is comprised of two lists.  I have an itemrenderer for both lists.  It appears that all of the TypeErrors that I am getting are related to these itemrenderers as far as I can tell.  I tried the utility that you suggested, but it did not show any data that really stood out to me other than the data provider for the lists had a bunch of [object Object] instead of concrete values listed.

In the itemrenderers, I used the dataChange event to manually set all of the values for the labels.  So, a button is clicked, the dataproviders are updated which triggers the dataChange event in the itemrenderers, then the lables are assigned values manually instead of using binding.  So there is absolutely no binding in my itemrenderers at all.(except the built in binding that is supposed to occur on the data object)

I am beginning to wonder if it is the dataprovider.  I remember in a very old project that I did, I ran into a problem where I would get an error in a dataprovider saying that binding would not work with the dataprovider even though it was an ArrayCollection.  I remember that I had to convert all of the objects in the arraycollection to objectproxies to get the error to disappear.  I wonder if that is happening here for some reason.

Anybody have any thoughts?  My program works as expected, but the performance is horrendous so I am trying to improve performance by removing any exceptions and other problems.
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
In reply to this post by clintm
I removed the itemrenderers altogether and I no longer get the TypeError and the performance is MUCH better, so I know that the itemrenderers are the culprits.  But when the itemrenderers are used, I am absolutely using no binding, and I even commented out all of the code that assigns the data to the various labels, essentially just leaving them blank.  I STILL get all of the TypeErrors without assigning data to anything, and not using any binding.

Any thoughts at all?  Why isn't there actually an Error Number associated with the TypeError?  It just says TypeError with no number associated with it.
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Alex Harui
Can you post the code for the item renderer?

-Alex

On 11/16/16, 8:44 PM, "bilbosax" <[hidden email]> wrote:

>I removed the itemrenderers altogether and I no longer get the TypeError
>and
>the performance is MUCH better, so I know that the itemrenderers are the
>culprits.  But when the itemrenderers are used, I am absolutely using no
>binding, and I even commented out all of the code that assigns the data to
>the various labels, essentially just leaving them blank.  I STILL get all
>of
>the TypeErrors without assigning data to anything, and not using any
>binding.
>
>Any thoughts at all?  Why isn't there actually an Error Number associated
>with the TypeError?  It just says TypeError with no number associated with
>it.
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Scout-What-does-this-mean-t
>p14126p14131.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
Absolutely!  Here it is:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx"
                                autoDrawBackground="true" dataChange="setValues(event)">
       
        <fx:Script>
               
<![CDATA[
			import mx.events.FlexEvent;
			
			protected function setValues(event:FlexEvent):void
			{
				if (data==null){
					address.text = "";
					city.text = "";
					built.text = "Built: ";
					status.text = "";
					beds.text = "";
					bathsFull.text = "";
					bathsHalf.text = "";
					fireplace.text = "";
					sqFtMain.text = "";
					basementLabel.text = "";
					sqFtTotal.text = "";
					propType.text = "";
					levels.text = "";
					garage.text = "";
					schoolDist.text = "";
					subdivision.text = "";				
					
				} else {					
				
					address.text = String(data.address);
					city.text = String(data.city) + ", " + String(data.zipcode);
					built.text = "Built: " + String(data.built);
					beds.text = String(data.beds);
					bathsFull.text = String(data.bathsFull);
					bathsHalf.text = String(data.bathsHalf);
					fireplace.text = String(data.fireplace);
					sqFtMain.text = String(data.sqFtMain);
					sqFtTotal.text = String(data.sqFtTotal);
					propType.text = String(data.propType);
					levels.text = String(data.levels);
					garage.text = String(data.garage);
					schoolDist.text = String(data.schoolDistrict);
					subdivision.text = String(data.subdivision);
					
					if (data.basement == 1) {
						basementLabel.text = "Yes";
					} else {
						basementLabel.text = "No";
					}
					
					if (data.status == "A") {
						status.text = "Status: Active";
					} else if (data.status == "AC") {
						status.text = "Status: Active/C";
					} else if (data.status == "P") {
						status.text = "Status: Pending";
					} else if (data.status == "S") {
						status.text = "Status: Sold";
					}
					
					if (data.incl == true) {
						includeRadioButton.selected = true;
					} else {
						includeRadioButton.selected = false;
					}
				}
			}
			
			protected function compClickHandler(event:MouseEvent):void {
				var e:Event = new Event("propClicked", true);
				dispatchEvent(e);
			}
			
			protected function radioClickedHandler(event:MouseEvent):void
			{
				var e:Event = new Event("radioClicked", true);
				dispatchEvent(e);
			}
			
		]]>

        </fx:Script>
       
        <fx:Declarations>
                <s:CurrencyFormatter id="moneyFormatter" currencySymbol="$" useCurrencySymbol="true" negativeCurrencyFormat="1" positiveCurrencyFormat="0" fractionalDigits="0"/>
        </fx:Declarations>
       
        <s:HGroup width="100%" gap="0">
                <s:Group width="9%">
                        <s:Label text="{data.MLSNum}" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" left="5" top="7" textDecoration="underline" click="compClickHandler(event)"/>
                </s:Group>
                <s:Group width="5%">
                        <s:RadioButton id="includeRadioButton" width="30" height="30" horizontalCenter="0" top="3" skinClass="skins.buttonSkins.radioButtonSkin" click="radioClickedHandler(event)"/>
                </s:Group>
                <s:Group width="10%">
                        <s:Label text="{moneyFormatter.format(data.price)}" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" left="5" top="7"/>
                </s:Group>
                <s:Group width="76%">
                        <s:HGroup gap="0" width="100%">       
                                <s:Group id="group1" width="26%">                       
                                        <s:Label id="address" top="7" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" maxDisplayedLines="1" maxWidth="{group1.width}"/>
                                        <s:Label id="city" top="24" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" maxDisplayedLines="1" maxWidth="{group1.width}"/>
                                        <s:Label id="built" text="Built: {data.built}" top="41" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="status" top="58" left="7" paddingBottom="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                </s:Group>
                               
                                <s:Group width="11.5%">
                                        <s:Label text="Beds:" top="7" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="BthsFll:" top="24" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="BthsHlf:" top="41" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="Frplc:" top="58" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                </s:Group>
                               
                                <s:Group width="5%">                       
                                        <s:Label id="beds" top="7" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="bathsFull" top="24" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="bathsHalf" top="41" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="fireplace" top="58" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                </s:Group>
                               
                               
                                <s:Group width="12.5%">       
                                        <s:Label text="SqFtMain:" top="7" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="Bsmt:" top="24" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="SqFtTot:" top="41" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="Type:" top="58" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                </s:Group>
                               
                                <s:Group width="7%">
                                        <s:Label id="sqFtMain" top="7" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="basementLabel" top="24" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="sqFtTotal" top="41" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="propType" top="58" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                </s:Group>
                               
                                <s:Group width="11.5%">       
                                        <s:Label text="Lvls:" top="7" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="Grg:" top="24" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="SchDst:" top="41" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label text="Subdv:" top="58" right="0" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                </s:Group>
                               
                                <s:Group id="group7" width="25%">
                                        <s:Label id="levels" top="7" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="garage" top="24" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" />
                                        <s:Label id="schoolDist" top="41" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" maxDisplayedLines="1" maxWidth="{group7.width}"/>
                                        <s:Label id="subdivision" top="58" left="7" fontFamily="MyriadPro" fontSize="14" color="#EBEBEB" maxDisplayedLines="1" maxWidth="{group7.width}"/>
                                </s:Group>
                        </s:HGroup>
                </s:Group>
        </s:HGroup>
       
</s:ItemRenderer>
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Olaf Krueger
Hi,

>... not using any binding.
I'm not have followed the complete discussion here but cause there're still some bindings left I wonder if this is the origin code or if you maybe have overlook some bindings [1]?

HTH,
Olaf

[1]
{data.MLSNum}
{group1.width}
{group7.width}
...

Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
You are right, there are two bindings left which I will fix shortly.  But those two bindings would not account for the 350 TypeError Exceptions that are being thrown.  The TypeError Exceptions are being thrown even when I comment out the code that assigns values to the text properties and the two remaining bindings that you can see.  So if this TypeError is associated with a binding problem, it is not one thrown because of me using binding expressions.  If I take out ALL uses of variable names, I still get hundreds of TypeError Exceptions.
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
And how come Scout is not giving a number to the TypeError so I can identify it more precisely???  When I use scout on a debug version of the SWF, all of the TypeErrors start with:

Exception: TypeError
Function/<anonymous>
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Olaf Krueger
In reply to this post by Olaf Krueger
Regarding performance:
To improve performance you want to avoid any kind of percentage calclulations and deep nesting of components. You also could think of removing embracing groups to reduce the number of components. The less the better.
At least you could replace relative positioning by absolute positioning.
Going this way you have to set a fixed with for the itemRenderer and just place the Labels by using its x and y property.

Of course it depends on your use case which option is really an option... but at least performance is the most important thing ;-)

HTH,
Olaf
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Olaf Krueger
In reply to this post by bilbosax
bilbosax wrote
You are right, there are two bindings left which I will fix shortly.  But those two bindings would not account for the 350 TypeError Exceptions that are being thrown.  The TypeError Exceptions are being thrown even when I comment out the code that assigns values to the text properties and the two remaining bindings that you can see.  So if this TypeError is associated with a binding problem, it is not one thrown because of me using binding expressions.  If I take out ALL uses of variable names, I still get hundreds of TypeError Exceptions.
I do not understand you completely but I would try following steps:
- Make sure that your data object always contains the properties that you access and check if the type conversions/casting do not throw errors (e.g. address.text =  String(data.address))
- Reduce the comlexity of your item renderer, place just one label and assign one data property and see what happens
- I don't know if this would make a difference but I notice that you use the "dataChanged" event. Do you already tried the alternative which is overwriting the data setter inside your ItemRenderer [1][2]?

HTH,
Olaf

[1] http://help.adobe.com/en_US/flex/using/WS77c1dbb1bd80d3836ecbb5ec129ec77b1e1-8000.html#WS81F79717-DDA9-4cd3-A8CC-4D384C6ED934

[2]
override public function set data(value:Object):void {
   super.data = value;
   ...
   address.text = String(data.address);
   ...
}
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Alex Harui
In reply to this post by Olaf Krueger


On 11/16/16, 10:27 PM, "OK" <[hidden email]> wrote:

>Regarding performance:
>To improve performance you want to avoid any kind of percentage
>calclulations and deep nesting of components. You also could think of
>removing embracing groups to reduce the number of components. The less the
>better.

That's for sure.  12 groups and 30 Labels per renderer is quite a bit.
I think Spark label may be slower than MX Label, although MX Label doesn't
do right-to-left text.

>At least you could replace relative positioning by absolute positioning.
>Going this way you have to set a fixed with for the itemRenderer and just
>place the Labels by using its x and y property.

If your app resizes the renderers, then before fixing widths, I would
first try removing the groups and writing ActionScript code that sizes and
positions the labels based on the width of the renderer.  IOW, you would
be essentially writing a custom layout.

If you replace bindings with a dataChange handler, that should help as
well.

HTH,
-Alex

Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
I can tell from using Scout that a large chunk of time is used doing measuring, which I assumed was because of the calculation of sizing everything. I chose to use groups because I found out very quickly that on mobile, pixel densities and screen resolutions vary a lot among the large number of devices. This causes problems because if you use an absolute number for X or y, it may get scaled based on the pixel density of your device leading to unexpected results. Going with percentage-based Groups insured that everything would look right regardless of the device. I guess the cost is performance. Tomorrow, I will try to lay everything out using absolute positioning. I just don't know if it will turn out significantly faster because I will still have to manually calculate the distance of all of these elements.

So I can work on the performance issues of the renderer, but what about these hundreds of TypeErrors? Do you see anything in my code that could be triggering those?
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Olaf Krueger
bilbosax wrote
...what about these hundreds of TypeErrors? Do you see anything in my code that could be triggering those?
Maybe you've overlooked my last post, do you've checked if the casting works properly?
E.g. address.text =  String(data.address))

HTH,
Olaf

Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Alex Harui
In reply to this post by bilbosax


On 11/16/16, 11:19 PM, "bilbosax" <[hidden email]> wrote:

>I can tell from using Scout that a large chunk of time is used doing
>measuring, which I assumed was because of the calculation of sizing
>everything. I chose to use groups because I found out very quickly that on
>mobile, pixel densities and screen resolutions vary a lot among the large
>number of devices. This causes problems because if you use an absolute
>number for X or y, it may get scaled based on the pixel density of your
>device leading to unexpected results. Going with percentage-based Groups
>insured that everything would look right regardless of the device. I guess
>the cost is performance. Tomorrow, I will try to lay everything out using
>absolute positioning. I just don't know if it will turn out significantly
>faster because I will still have to manually calculate the distance of all
>of these elements.

Again, before setting explicit widths, first try running a custom layout
pass so you don't need all of those groups.  Some code could simply do:

Var w:Number = renderer.width;
SomeLabel.width = .15 * w;
SomeLabel2.width = .06 * w;
...
Var colWidth:Number = w * .15;
SomeLabel.x = colWidth;
...

This should get rid of the Groups and result in fewer measure calls on the
components.

>
>So I can work on the performance issues of the renderer, but what about
>these hundreds of TypeErrors? Do you see anything in my code that could be
>triggering those?

Getting rid of the binding should get rid of the TypeErrors.  Binding uses
an anonymous function in some cases to listen and respond for changes.
Some of the bindings were to group1.width.  Your new custom layout will
compute group1.width and set it on the right components.

HTH,
-Alex

Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

piotrz
In reply to this post by bilbosax
Hi,

You could also completely remove main HGroup and just have [1] :)

[1] https://paste.apache.org/hcay

Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Josh Tynjala
In reply to this post by bilbosax
This binding is more complex than the others because it passes a value to a
formatter method, so it seems to me that it's more likely to throw an error.

text="{moneyFormatter.format(data.price)}"

- Josh

On Wed, Nov 16, 2016 at 11:19 PM, bilbosax <[hidden email]> wrote:

> I can tell from using Scout that a large chunk of time is used doing
> measuring, which I assumed was because of the calculation of sizing
> everything. I chose to use groups because I found out very quickly that on
> mobile, pixel densities and screen resolutions vary a lot among the large
> number of devices. This causes problems because if you use an absolute
> number for X or y, it may get scaled based on the pixel density of your
> device leading to unexpected results. Going with percentage-based Groups
> insured that everything would look right regardless of the device. I guess
> the cost is performance. Tomorrow, I will try to lay everything out using
> absolute positioning. I just don't know if it will turn out significantly
> faster because I will still have to manually calculate the distance of all
> of these elements.
>
> So I can work on the performance issues of the renderer, but what about
> these hundreds of TypeErrors? Do you see anything in my code that could be
> triggering those?
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Scout-What-does-this-mean-tp14126p14140.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

bilbosax
In reply to this post by Alex Harui
I am having a bit of trouble with the custom layout, I believe because of scaling issues related to screen DPI.  What lays out nicely in the emulator is WAY off when loaded onto my iPad.  So I have come up with this, which includes a scaling factor, but it feels a bit like a hack and I don't know if it is appropriate.  For every X value that I calculate, I have to divide it by a scale factor to adjust for screen density.  Let me know if you think there is a better way.

var itemRendererWidth:int = renderer.width;
var scale = Capabilities.screenDPI/132;
var col1x = .15*itemRendererWidth/scale;

label1.x = col1x;
label1.text = data.address;
Reply | Threaded
Open this post in threaded view
|

Re: Scout - What does this mean?

Alex Harui


On 11/17/16, 1:56 PM, "bilbosax" <[hidden email]> wrote:

>I am having a bit of trouble with the custom layout, I believe because of
>scaling issues related to screen DPI.  What lays out nicely in the
>emulator
>is WAY off when loaded onto my iPad.  So I have come up with this, which
>includes a scaling factor, but it feels a bit like a hack and I don't know
>if it is appropriate.  For every X value that I calculate, I have to
>divide
>it by a scale factor to adjust for screen density.  Let me know if you
>think
>there is a better way.
>
>var itemRendererWidth:int = renderer.width;
>var scale = Capabilities.screenDPI/132;
>var col1x = .15*itemRendererWidth/scale;
>
>label1.x = col1x;
>label1.text = data.address;

Makes me think something else is wrong.  First verify that the
renderer.width is reasonable in emulator and on the device.  Then we can
try to figure out the right answer.

But before you even do that, I would not worry about how nice it looks, I
would just make sure you can see every Label like you used to and see if
your performance got better.  No need to polish a turd, as a former
colleague used to say.

-Alex

123