Hi all;
I hesitated to introduce new questions to this list concerning my matter in
this
same thread since it has taken such interesting turns into quarks and bosons
and
what not, but then I thought it best if anyone were to google it to be
continuous.
I am in the process of joining Flash_Tiger but await moderator approval. In the
interim, perhaps you could continue to help me a bit here.
I am attempting the more complicated approach of custom events. I googled and
the information I got was not entirely luminous (at my beginning level of
understanding). Here is a slight revision of my previous code:
function RotateGears()
{
var path:String = new String();
path = gearsPaths[displayGearsCounter];
var req:URLRequest = new URLRequest(path);
var loader:Loader = new Loader();
loader.load(req);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
LoadGearData.displayGearsCounter);
}
function RotateGearsLoaded(e:Event):void
{
var loaderInfo:LoaderInfo = e.target as LoaderInfo;
var displayObject:DisplayObject = loaderInfo.content;
displayObject.width = gearWidths[displayGearsCounter];
displayObject.height = gearHeights[displayGearsCounter];
// displayObject.x = - gearWidths[displayGearsCounter];
// displayObject.y = - gearWidths[displayGearsCounter];
displayObject.x = 0;
displayObject.y = 0;
trace(displayGearsCounter);
parent_container.addChild(displayObject);
parent_container.x = 0;
parent_container.y = 0;
parent_container.alpha = 1;
addChild(parent_container);
var myTimeline:TimelineLite = new TimelineLite({useFrames:true});
myTimeline.append(new TweenMax(parent_container, 1,
{shortRotation:{rotation:gearAngles[displayGearsCounter]}}));
}
}
I also import the following script, which is a slight tweak of something I
googled:
package {
import flash.events.Event;
public class LoadGearData extends flash.events.Event
{
public static const displayGearsCounter:int = 0;
private var command:String;
public function LoadGearData (command:String )
{
super(displayGearsCounter);
this.command = command;
}
}
}
Now, what I'm trying to do is get RotateGearsLoaded() to fire with the correct
value of displayGearsCounter (as it increments). I'm lost as to how to
understand how calling LoadGearData() is supposed to do that. Please elucidate.
TIA.
John
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders