I've started learning flex and as a first project I've created a component from the example found here component with which I call into the main application (web based).
When I rotate the image it goes well,
however, when I resize the application, my component which fills the application container ie width, height 100%, seems to make the rotations calculus based on it's previous width and height.
So basically the rotations go wrong when I resize the app. Any ideas on how to fix this?
I had to recalculate the view's perspective point upon the app resize event.
Related
I'm developing a web app using Flex. This app allows to draw forms in a Canvas (like MSPaint in Windows).
Now, I want a new feature on it: an infinite canvas. The user should be able to drag the main Canvas and this should be infinite in X and Y axis. Consecuently, this Canvas should be resized in real time.
Obviously, I don't want to create a Canvas of 1k x 1k pixels with zoom in an specific area to give the feeling of an infinite drawing area.
How could I achieve it? Any suggestions or ideas are welcome :)
EDIT:
I just read that Flash/Flex Flash/Air supports canvases up to 4056x4056 px, not infinite.
You might want to reconsider how you implement your infinite canvas - a single, ever growing canvas, is likely to cause performance issues.
Instead, consider breaking your canvas into virtual canvases of fixed size (I'd recommend much smaller than the max of 4056x4056), and then stitch them together at runtime, as the user pans around.
I'm developing a presentation tool for AIR (to be used together with, or as a replacement to, PowerPoint) but I'm quite a newcomer to flex layouting.
As you can see from the image, the presenter can open various apps from the main window.
Each of these apps open up in new windows which have different visual characteristics; some use the main content area to show graphics, others bullet points. Most app windows have buttons and view stacks with embedded Flash assets (using s:SpriteVisualElement).
My questions are the following:
1a. When developing a PowerPoint-like presentation tool with Flex, which layout type (basic, vertical etc.) will provide most flexibility?
1b. How do I make sure no clipping occurs on various projector screens - which aspect ratio should I have in mind?
2a. How can I resize children sprites in the SpriteVisualElement container proportionally to the window resolution?
2b. And where do I place this resize logic - on each component (sprite) with resizeHandlers or in one resizeHandler / window?
Please use the comment thread if you want me to elaborate further. Thanks.
Since you're new to Flex, I strongly reading up on the Flex Component LifeCycle.
1a. When developing a PowerPoint-like presentation tool with
Flex, which layout type (basic,
vertical etc.) will provide most
flexibility?
The layout you choose will depend on what you want to display. I don't see layouts as "Flexible". They do their job and position their elements appropriately. I can easily envision using all types of layouts in such a complicated application, each for different purposes.
1b. How do I make sure no clipping occurs on various projector screens -
which aspect ratio should I have in
mind?
I'm not quite sure I understand what this question means, but I take it to mean you want to avoid the presence of scroll bars in your app. To do that, you'll have to develop layout code that sizes and positions your children so that they do not extend past the height and width of your available content space. In Flex 3 (Halo) architecture, this would be done by writing an updateDisplayList() method for your component. In the Flex 4 (Spark) architecture, this would probably be done by writing an updateDisplayList() method for your skin class.
2a. How can I resize children sprites in the SpriteVisualElement
container proportionally to the window
resolution?
I believe my above answer already addresses this.
2b. And where do I place this resize logic - on each component
(sprite) with resizeHandlers or in one
resizeHandler / window?
In a resize handler, I would most likely use invalidateSkinState and/or invalidateDisplayList. The resizing code would be in the skin and/or updateDisplayList.
I'm working on a Flex 4 application and I started customizing the interface with skins to give a whole new look.
So, I've created two scrollbar skins in Flash Catalyst (one horizontal, one vertical).
Its working great when I test the application through Catalyst so I took it and imported it on Flash Builder, copied the components and defined the new skins in my css file for the HScrollbar and VScrollbar.
The skin is working, all the buttons are ok. But, the scrollbar isnt resizing for some reason. It remains in the same height I've designed it to be regardless of the content it is bound to.
It scrolls the content in all the ways it should be but it doesnt resize and the thumb isnt getting all the way down.
Also I've noticed the following.
I have a custom component acting as a list. It extends Group and contains a Scroller. So at one place of the application the Scrollthumb is getting lower than on another place where the same custom list is used.
I also have to mention that this scroller works perfectly without a custom skin.
Anyone else having similar problems?
Okay, I know you posted this a while ago but I have been scouring the internet for days looking for why the scrollbar's thumb wasn't scaling like the default scrollbar.
There are a couple things to check, first is there a set height on your thumb's skin?
If not, and this is what I was overlooking, go to your scroller skin and at the point where you add the vertical and horizontal scrollbar set the "fixedThumbSize" property to false.
I suppose that your graphic elements are defined as every single part of the scrollbar (top arrow, bottom arrow, track, etc...): in this case you should check that the elements dimensions are not fixed... they should be in % to be able to change the dimensions based on the container.
I am creating Sprite objects as simple shapes, and would like to know how to resize them dynamically.
my question:
How can I enable the Sprite to be re-sized on mouse drag(perhaps enabling a only a portion of the Sprite for this behavior)?
It might be important to note that I am using the Flex SDK, and therefore do not have full
access to the Flash libraries.
Thank you in advance.
You might want to check out the Flex Object Handles open source library. Check out the demo to see how it can be used to allow users to resize any object in a Flex app.
Doesn't the sprite always adapt itself to its contents to set its height and width? (like movieclips in as2). If you want to resize a sprite, I guess you'd have to draw something as background?
What do you mean by enabling a portion of the sprite to be re-sized?
I have the following problem. I use a custom component for painting a graph on a canvas, now when the windows is resized I want to determine the actual width and height of my canvas to resize the graph as well, therefore I used the resize event I can use in mxml.
Now I detected in my method for resizing I only receive the width and height of the canvas just before resizing not after. When grabbing an edge of my window and moving it slowly for resizing this does not matter but when maximizing or minimizing the windows, this plays a more important role. Can someone tell me the reason for that behaviour? What is the proper solution for that problem?
Thanks in advance
Sebastian
If you use the resize event, you should check the width and height of currentTarget property in the event.