Tag Archives: StyleSheet

Tech Tips: Prevent scaling in ActionScript projects

Problem:
The scale mode for ActionScript projects is set to allow zooming by default even when the width and height are set to fixed sizes. This can distort your website when the user uses ctrl-mouse scroll wheel or hits ctrl-plus / ctrl-minus.

Solution:
Set the stage scaleMode to “noScale” and configure the containing div to stretch at 100% for the height and width. You may also want to set the stage alignment to “T” which will align your content to the top of the page. This will work in AS2 as well but the ‘S’ is capitalized in Stage.
Read more

Filed under Technology

Tech Tuesday: Using anchor tags in ActionScript TextFields

This example is for anyone who needs to use anchor tags in ActionScript TextFields. If you’re using AIR then the best route is to use an HTMLLoader to load in the raw HTML. If an HTMLLoader is not an option you can use this example to create a wrapper class that mimics the anchor tag functionality. Before we get started it is important to note that TextFields have a number of properties, formats, and styles available which all have an effect on the way text is rendered. This example takes advantage of a specific set of properties in order to accurately determine the line number and char location of certain strings. Variables may require some adjustments / tweaks (or may not work at all) if the TextField properties are changed.
Read more

Filed under Technology