dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: SetProperty

Hybrid View

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    192

    SetProperty

    Hi,

    I got a simple question. But not quite sure how to go about it.

    I'm using set property scale a movie:
    on (release) {
    setProperty(_root.skate,_yscale,500);
    }

    I have the movie clip on the main timeline called "skate". Now I want it to scale with a motion tween;

    Any ideas.

    regards,
    shalin
    ScreenSwift For Flash
    Convert Flash Movie to ScreenSaver
    http://www.tenmiles.com/

  2. #2
    feeling froggy
    Join Date
    Jul 2002
    Posts
    179
    Code:
    on (release) {
       if(_root.skate._yscale<=500){
          onEnterFrame = function(){
          _root.skate._yscale += 10;//10 or any other positive number
           }
       }else{
          delete onEnterFrame;
          }
    }

  3. #3
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    ??

    You want to scale it with a motion tween after scaling it to half it's size using actionscript? Why not just make the usual motion tween on stage and physically control the size?
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Posts
    192
    Hi,

    thanks for the quick reply.

    I tried out the code it didn't work.
    I changed the code to somthing like this:

    on (release) {
    if(_root.skate._xscale<=500){
    skate.onEnterFrame = function(){
    trace("On Enter Frame Called");
    _root.skate._xscale+= 10;//10 or any other positive number
    }
    }else{
    delete skate.onEnterFrame;
    trace("not entered");
    }
    }

    Where do I call the function?

    - Shalin

    PS Garbage: I need to modify the movieclip on the fly!
    ScreenSwift For Flash
    Convert Flash Movie to ScreenSaver
    http://www.tenmiles.com/

  5. #5
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Code:
    on (release) {
     if(_root.skate._xscale <= 500) {
      _root.skate.onEnterFrame = function() {
       if (this._xscale <= 500) {
        this._xscale += 10;
       } else {
        delete this.onEnterFrame;
       }
      }
     }else{
      trace("MC 'skate' X scale > 500");
     }
    }
    May I suggest this? The function is actually in the code, shalin - it is attached to the _root.skate movieClip. I think the problem with the original code posted by norie40 was that the condition to make the clip grow was only called once (when the button was released), which means the clip could grow as big as it liked. This version makes sure it can get any bigger than 500% - after that, the code that was attached to the skate MC deletes itself (again, this was a function of the button in the original.

    Let me know if this works any better.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Posts
    192
    thanks garbage.

    I tried out this code as well. it doesn't get into any of the IF conditions of the function. I wonder why.

    Your suggestions please.

    Thank a lot.

    cheers,
    shalin
    ScreenSwift For Flash
    Convert Flash Movie to ScreenSaver
    http://www.tenmiles.com/

  7. #7
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Code:
    on (release) {
     if(_root.skate._xscale <= 500) {
      _root.skate.onEnterFrame = function() {
       if (_root.skate._xscale <= 500) {
        _root.skate._xscale += 10;
       } else {
        delete _root.skate.onEnterFrame;
       }
      }
     }else{
      trace("MC 'skate' X scale > 500");
     }
    }
    Try that ... might have been to do with the MC addressing inside the function.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Posts
    192
    wow! works great.

    "skate" was my movieclip name and not the instance and thats why it wasn't working.

    it works great now. thanks a lot for all the help.

    Cheers,
    Shalin
    ScreenSwift For Flash
    Convert Flash Movie to ScreenSaver
    http://www.tenmiles.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center