Graphics Reference
In-Depth Information
s actually happening
insidetheclass.OnceaninstanceofBorderButtoniscreated,you
Now let
'
s take a very high-level look at what
'
ll
call the draw method that uses its parameters to draw the button.
The next thing you
'
ll want to do is call the activate method and
pass in the target URL to make the instance of BorderButton clickable.
Other methods in the BorderButton class include erase and deacti-
vate , which do exactly what their names imply: remove the instance
and make it nonclickable. One implementation of BorderButton
might be as seen in Example 3.5. You could alternatively use Border-
Button in conjunction with the ClickTagger class as in Example 3.6.
'
EXAMPLE 3.5
Using the ButtonBorder class alone
import com.flashadbook.display.BorderButton;
var borderButton:BorderButton = new BorderButton();
var targetUrl:String =
http://www.flashadbook.com
;
borderButton.draw(this);
borderButton.activate(targetUrl);
EXAMPLE 3.6
Using the ButtonBorder class in conjunction with the ClickTagger class
import com.flashadbook.utils.ClickTagger;
import com.flashadbook.display.BorderButton;
var fallBackUrl:String = http://www.flashadbook.com ;
var clickTagger:ClickTagger = new
ClickTagger(stage.loaderInfo);
var borderButton:BorderButton = new BorderButton();
borderButton.draw(this);
clickTagger.assignClickTag(borderButton,fallBackUrl,1);
Forms
Another good example of a reusable asset is a form. Forms will be
covered in more depth in Chapter 4, but for now, let
'
s assume that
we
'
ve already created one, and let
'
s simply call it
Our Form.
Our
Form was created to be used from within a banner that we
'
ve built
for client X, and its purpose is to search client X
'
s inventory for a
'
user
s desired product. Once we have Our Form built and function-
ing properly, we should set it aside in its own .fla so that each time
we need to use it in another banner we can just grab it, place it in
a new banner, and resize it or move elements around as needed.
TIP
In addition to reusable code, you should also keep an eye out for reusable
graphics such as logos, products, and backgrounds.
Search WWH ::




Custom Search