swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] _x and _y move everything? (bug?)


From: Jon Hartford
Subject: Re: [Swftools-common] _x and _y move everything? (bug?)
Date: Mon, 14 Apr 2008 11:57:31 -0700 (PDT)

Try http://peachcobbler.uni.cc/persondemo.swf (without the www.) if the other link isn't working. My web host is being retarded. Sorry.

Jon Hartford <address@hidden> wrote:
If I compile the following code and load the swf, the arrow keys make all the objects in the movie move. Is this right or should it only move the object that the script is attached to? (the person, but not the box):

.flash name="persondemo.swf" bbox=1000x1000 background="" compress
    .outline person_outline:
        M 35 1.65625 C 21.2 1.65625 9.9999996 12.856249 10 26.65625 C 10 34.834223 13.923281 42.094201 20 46.65625 L 1.4375 46.65625 L 1.4375 118.78125 L 67.15625 118.78125 L 67.15625 46.65625 L 50 46.65625 C 56.076719 42.094201 60 34.834222 60 26.65625 C 60 12.85625 48.8 1.65625 35 1.65625
    .end
    .filled person outline="person_outline" color=black fill=blue line=7
    .box b1 100 100 color=black fill=black
    .put b1 x=200 y=200
    .put person x=0 y=0
   
    .action:
        person. {walkSpeed = 5;};
        person. {
            if (Key.isDown(Key.UP)) {
                _y-=walkSpeed;
            }
            if (Key.isDown(key.RIGHT)) {
                _x+=walkSpeed;
            }
            if (Key.isDown(key.LEFT)) {
                _x-=walkSpeed;
            }
            if (Key.isDown(key.DOWN)) {
                _y+=walkSpeed;
            }
        };
    .end
.end

Compiled: http://www.peachcobbler.uni.cc/persondemo.swf
(You have to click inside the bounding box to activate keyboard control.)


As far as I understand (I'm a newbie at actionscript, so it's likely I'm wrong), the person.onEnterFrame function is part of the person object, so it should only move the person, and not the box (b1).

It does the same thing if I put person._x and person._y, too.

I am using swftools 0.8.1 on Windows XP SP1. I haven't tried this with the current dev release.
 

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]