QuickNotes

szukowsk

Notes from my stupid mistakes


Drag Manager Docs
The offset field of doDrag is in relation to the spot you click the image to be dragged at.
Ex. If your image is 50 x 50 and you click the center (25, 25) then when you drag and drop, the images new upper left corner (0,0) will be in relation to the point you clicked the image on (in this case 25 25). So in this case, if you moved it 100 pixels to the right and it was at 0,0 to start then the new upper left corner would be at (125,25) and not (100,0) since you clicked the image in the center at (25, 25).


Embed Notes

[Embed(source='../assets/flex_logo.png')]
public var globeImage:Class;
This does indeed store the embeded file as the variable DIRRECTLY following the embed statement.
(NOTE: This is white space sensitive.)

Also, you must SAVE the file as the correct type. You can't just change the file type tag to .png, flex breaks because it's still it's original format but is accessed as the new type. You must manually open it in an editor and save it with the correct file type tag.


Changing Background Images

So far it seems flex will not let you change a background image at run time for the panel, application, or canvas classes. I am not sure about other objects but the general theme seems to be no, you can't change them at run time. A possible end around is just layer a panel or some other container at the back that takes up the whole screen and have the user select an image from a tool bar, flex then destroys the previous object and replaces it with this one... I am not sure how well this will work yet. The issue with this solution is flexes layering which puts the most recent creation on top... I need to find some way to get around that or manipulate it's layering.