I wanted to make a note to myself for the next time I pull my hair out for too long hunting down this ... bug?
In short, after a Loader object has completed loading, references to its DisplayObject content as well as its LoaderInfo content are not reliable. I found that occasionally simply using the Loader class as the DisplayObject to add to the display list was inconsistent, too.
For now, I'm finding that saving references to the Complete Event's currentTarget.content is the most reliable choice for accessing the loaded content.
Showing posts with label actionscript. Show all posts
Showing posts with label actionscript. Show all posts
28 October 2009
20 August 2009
finding the farm
I've been playing with Adobe's Flickr library (link), and have been stumped in locating how to pull a pic's static farm id from a person's public photos list.
After too much time googling, searching, and reading documentation, I finally weeded thru the source to discover the library simply fails to record the farm id retrieved from flickr. Oops.
I have updated two of the Actionscript files to correct this:
http://adam.gimpert.com/docs/farmfix.zip
Two things needed to be added:
1. The Photo class needed a new property (farm), and
2. The parsePagedPhotoList method in MethodGroupHelper needed to record the farm id from each photo's xml.
Now I can build photos' static urls. Yay.
After too much time googling, searching, and reading documentation, I finally weeded thru the source to discover the library simply fails to record the farm id retrieved from flickr. Oops.
I have updated two of the Actionscript files to correct this:
http://adam.gimpert.com/docs/farmfix.zip
Two things needed to be added:
1. The Photo class needed a new property (farm), and
2. The parsePagedPhotoList method in MethodGroupHelper needed to record the farm id from each photo's xml.
Now I can build photos' static urls. Yay.
12 August 2008
flash: bezier curve point
A bit of actionscript to interpolate a point at location 0<=i<=1 along a bezier curve defined by an array of control points, cPoints, of Points (from the flash.geom package):
Flash probably has this sort of function built in, but oh well, it's done =)
function getBezierPoint(cPoints:Array, i:Number):Point {
if (cPoints.length > 2) {
var subCPoints:Array = new Array();
for (var j:Number = 0; j < cPoints.length - 1; j++) {
subCPoints.push(Point.interpolate(cPoints[j], cPoints[j+1], 1-i));
}
return getBezierPoint(subCPoints, i);
} else {
return Point.interpolate(cPoints[0], cPoints[1], 1-i);
}
}
Flash probably has this sort of function built in, but oh well, it's done =)
Labels:
actionscript,
bezier,
code,
curve,
flash,
interpolate,
point
Subscribe to:
Posts (Atom)