On Mon, Dec 7, 2009 at 2:46 PM, <[email protected]> wrote:
> Hi Beno
>
> What I meant was to start with something like this:
>
> public function init():void {
> hatAndFace();
> eyeball1();
> eyeball2();
> myRightHand();
> mcHandInstance2 = new mcHand();
> addChild(mcHandInstance2)
> }
>
Changes tested. Must continue with:
var mcHandInstance2 = new mcHand();
or nothing prints to swf.
>
> What you haven't told is whether all the other handlers work, is
> myRightHand() creating the right hand and placing it on stage? What's
> different about myRightHand() and myLeftHand()? Does myRightHand() also
> create an instance of mcHand and put it visibly onstage? Does it use
> positional code to put in a particular location?
>
Everything else works. Here are the differences:
public function myRightHand():void
{
var mcHandInstance1:mcHand = new mcHand();
addChild(mcHandInstance1);
mcHandInstance1.x = 400;
mcHandInstance1.y = 200;
}
/*
public function set totalProgress(value:Number):void
{
myLeftHand.value = 1;
}
*/
// private function myLeftHand():void
private function myLeftHand(e:Event=null):void
{
if (e.target.currentFrame == 10) { trace("yes") };
var mcHandInstance2:mcHand = new mcHand();
addChild(mcHandInstance2);
mcHandInstance2.x = 800;
mcHandInstance2.y = 200;
// if (e.target.currentFrame == 40) TweenMax.to(mcHandInstance2, 2,
{x:200, startAt:{totalProgress:1}}).reverse();
}
}
}
What I am trying to accomplish is to make the left hand start from the end
of the general "hand" instance movie and go backwards. Think of having your
two hands at waist height pointing outward, then you point inward, as if you
were pointing to your bellybutton. The hands are mirror images, and that is
what I'm trying to print. It's that final commented-out line I need to work.
Of course, I started out with the same declarations in my init() function
for both hands, but that didn't satisfy the tweenMax needs.
>
> I have to admit, not seeing the full code and knowing what works and what
> doesn't makes it difficult to make any type of prediction. But if
> hatAndFace() and all the rest worked and only myLeftHand() wasn't and that
> was the reason for all the extra code in the init() method, I'd go back rip
> out the code in the init that creates the mcHandInstance2, make the
> myLeftHand() call directly as you did the rest. I'd double check that
> myRightHand() matched myLeftHand() with a positional only difference. Then
> I'd make certain that the position I was placing the left hand in was infact
> a visible screen location. I'd do like Jason suggested, put in a trace in
> myLeftHand
>
Did it. Didn't trace.
I'd also put a trace after myRightHand() call, just to make sure that the
> stack didn't quit out execution prior to hitting the myLeftHand() if all the
> traces worked but no left hand, I'd assign the left hand to a public
> property and do an inspection on x, y, alpha etc during debug to see what
> was going on. Be methodical. Change one thing at a time from what is known
> to work ie. asusming myRightHand() worked, duplicate that as myLeftHand()
> and change only the x position. See if it works, etc.
>
That's a good idea. I changed it to this:
public function myRightHand():void
{
var mcHandInstance1:mcHand = new mcHand();
addChild(mcHandInstance1);
mcHandInstance1.x = 400;
mcHandInstance1.y = 200;
if (e.target.currentFrame == 10) { trace("yes") };
}
which naturally threw an error, because there is no declaration of "e". At
least that seemed to indicate that the code was executing all the way
through the class. Then I removed consecutively the "e" (got same error on
"target", as I assumed) and the "target", and much to my (naive) surprise
the command was totally ignored!
TIA,
beno
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders