MultiScaleContainer Viewport Properties Bug

Edited on 10/27/09
I'm programing in Flex btw.

So I was looking through the multiScaleContainer code trying to figure out why the zoom property never seemed to be accurate to what zoom level the component was at. I've figured out that the viewPort object (a child of MultiScaleContainer) has a zoom property that does seem to be the zoom level of what the component is at.

When I was looking at the functions for get and set for zoom, scale, and other properties I noticed that there is a commented out note that says //FIXME... implying to me that you haven't implemented the fix that will update these values automatically.

My questions are twofold:

1) I've noticed a that you don't put a ';' character at the end of your lines. I'm not sure if this is a habit from starting out programming actionscript in Flash but I found it a bit confusing, because I always end my code lines with a ';' to mark the end of the line. I then noticed that you have code like such:

//----------------------------------
// zoom
//----------------------------------

private var _zoom:Number
private var zoomChanged:Boolean = false

;[Bindable(event="transformUpdate")]
// FIXME
/**
* @copy org.openzoom.flash.viewport.IViewport#zoom
*/
public function get zoom():Number
{
return _zoom
}

public function set zoom(value:Number):void
{
if (_zoom != value)
{
_zoom = value
zoomChanged = true
invalidateProperties()
}
}
//----------------

Does the ';' before the [Bindable(event="transformUpdate")] mean or do anything? Does it essentially comment the event out? I can tell you are trying to get the zoom values to update automatically when the transformUpdate event is triggered (presumably by the viewPort component) but it doesn't seem to be working yet. What exactly needs to be fixed? This brings me to my next question:

2) I can see from browsing your code that you do a lot of event declaring before get/set functions. Does this mean that the event will get triggered if the get/set functions are run. It seemed like your code in the NormalizedViewport class was doing that but the code above seems to be an attempt to catch the event, not dispatch it. Am I off base here, or have you just not implemented the code to catch the zoom value from the viewPort yet? Is there somewhere I can go to try to better understand these "Bindable Getter/Setter' events? I was looking through the flex documentation but couldn't find it.

The whole reason I was doing this was to try and create an event that got dispatched on the component when the zoom level changed so I could see what the zoom level was at? I managed to do this by making a zoomEvent dispatched from the viewport, caught by the multiScaleContainer and then dispatched from there to the next parent. (I was going to use the bubbles variable but it seemed like the constraints weren't being acknowledged in the viewPort component and thus the viewPort.zoom property could be off when a zoom was first changed. I was doing this to try and understand the size of sprites with regards to the sceneHeight and sceneWidth properties and the zoom property.

Hopefully this isn't too detailed. Thanks a lot : )
 
silly I’m unsure
Inappropriate?
2 people have this problem

The company has acknowledged this problem.

See the changes made to this problem
User_default_medium