0

Transversing the Display List Correctly

Transversing the Display List Correctly via @largestartist Posted by Jose Cuadra on December 10, 2009 Tags: Filed Under: References

When coming from JavaScript a common mistake when drilling down through objects is that chaining doesn’t work like you would think in AS3. Yes the languages are similar but here’s a difference.

DOM

In JavaScript you would transverse the DOM using a method called “getElementsByTagName().” You can chain these to dig into the objects.

//This grabs the first input field inside the first div on the page
var textField = document.getElementsByTagName("div")[0].getElementsByTagName("input")[0];

Now in ActionScript you can’t double up on the “getChildAt()” method, because that method doesn’t have a method of “getChildAt().” Confused yet?

In ActionScript 3 you have to cast the method into an object so you can use the method again to drill down.

ActionScript 3

var sprite:Sprite = new Sprite();
var txtField:TextField = new TextField();
txtField.text = "something";
sprite.addChild(txtField);
stage.addChild(sprite);
 
//Cast the object returned to a DisplayObjectContainer 
var path:Sprite = Sprite(stage.getChildAt(1));
 
trace(path.getChildAt(0));//[object TextField]
//trace(stage.getChildAt(1).getChildAt(0));//Error - 1061: Call to possibly undefined method getChildAt through reference with static type flash.displa:DisplayObject.
0

From Work Path to Shape Layer

From Work Path to Shape Layer via @largestartist Posted by Jose Cuadra on October 8, 2009 Tags: | | | | | | | Filed Under: References

After Creating a Path…

Select the path with the Direct Selection Tool.
Translation: Take the white arrow in your toolbar and click on the path. The anchor points will appear letting you know it’s selected.
Create new fill or adjustment layer.
Translation: Click on the half white/half black circular icon at the bottom of the layers panel. From the pop up select the type of layer you wish to create. (Solid, Gradient, Pattern, etc.)

A Vector Mask generated from your Path will now be included in the layer you just created.

0

CFCACHE, IE, CSS and XHTML

CFCACHE, IE, CSS and XHTML via @largestartist Posted by Jose Cuadra on September 4, 2009 Tags: | | | | | | | Filed Under: References

Yesterday I experienced an unusual rendering issue in Internet Explorer. The entire layout was aligning left and a couple z-index declarations were being ignored. Usually you can fix the minor issues with some Conditional Comments but these inconsistencies were too great to blame on the Trident Layout Engine(MSHTML). Besides, before I added Coldfusion to the mix it rendered properly in every browser.

Continue Reading…

0

Conditional Shortcut in ActionScript

Conditional Shortcut in ActionScript via @largestartist Posted by Jose Cuadra on August 3, 2009 Tags: Filed Under: References

While thumbing through an old ActionScript book(Training from the Source) I found a shorthand approach to the conditional statement.

Continue Reading…

0

Multiple On Load Events

Multiple On Load Events via @largestartist Posted by Jose Cuadra on June 30, 2009 Tags: | Filed Under: References

A common issue that arises when developing web applications with JavaScript is that the onload events interfere with each other. With all the freely available frameworks and apps at a users disposal there is a strong possibility the onload event is already being used in a project… incorrectly. (I admit I am guilty of this.)

Continue Reading…

0

Target Blank for XHTML

Target Blank for XHTML via @largestartist Posted by Jose Cuadra on April 21, 2009 Tags: | | | Filed Under: References

Given that the target attribute for the anchor tag does not comply with the W3C recommendation, which in turn does not validate, creating a new window for a link is not possible using a Strict XHTML Doctype.

Continue Reading…

0

Dreamweaver CS3 Start and Crash Bug

Dreamweaver CS3 Start and Crash Bug via @largestartist Posted by Jose Cuadra on April 10, 2009 Tags: | | | Filed Under: References

Dreamweaver Logo

I just experienced an unusual bug that prevented Dreamweaver from starting up completely. It actually kept closing by itself right before displaying all the panels.

Continue Reading…

0

Pencil Painting with Nickelsen

A new technique I am learning is a process called Color Pencil Painting where you use paint thinner as a blending tool with rich color pencils. Searches of this technique yield one recurring name as a result, Alyona Nickelsen.

Continue Reading…

2

Table Behavior without Tables

Table Behavior without Tables via @largestartist Posted by Jose Cuadra on March 28, 2009 Tags: | | | Filed Under: References

Many times a “table like” layout is necessary to abide by the Rule of Thirds law, specially with the currently popular “magazine” type website layouts.

Adding a table to the layout would simply be too easy, and wouldn’t fit into the “Do Everything without Tables” mentality plaguing the web. So I demonstrate how to achieve the behavior without the table.

Continue Reading…

0

JavaScripted Tooltips

JavaScripted Tooltips via @largestartist Posted by Jose Cuadra on March 24, 2009 Tags: | | | Filed Under: References

Here is a simple attempt at some JavaScripted tooltips. I expect there to be bugs when you have two “sticky” tooltips overlapping each other.

Continue Reading…