The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 11 of 11

Thread: Is there a way to control the Smoking not going above the stage?

  1. #1

    Is there a way to control the Smoking not going above the stage?


    In the following example (File attached), the smoke goes above the stage. I want to avoid it, and limit the smoke to go maximum up to the stage.

    I need it because my flash is auto re-sizable to the browser width & height. And when the smoke go above the stage my swf file starts shrink and gets very small.

    How to solve this problem?

    Please help.
    Attached Files Attached Files

  2. #2
    You can set a scrollRect on the stage.

  3. #3
    Could you please help me with an example.


  4. #4
    stage.scrollRect = new Rectangle(0,0,800,600);

  5. #5
    I tried the same code, but still the smoke goes out of the stage.

    The stage size is: 250 x 245

    var count:Number = 0;
    var delay:Number = 0;
    onEnterFrame = function () {
        if (delay>4) {
            delay = 0;
            smokename = "smoke"+count;
            smk.duplicateMovieClip(smokename, count);
    stage.scrollRect = new Rectangle(0,0,220,220);
    Last edited by learner_7n; April 19th, 2012 at 04:30 PM.

  6. #6
    You're using AS2 — I don't believe scrollRect exists in AS2

  7. #7
    I have downloaded this code from a website and want to use this effect in my project. Actually I am using AS3. Is it easy to change the above as2 code to as3 or any other option to resolve my problem.

    Expecting help from the experts in this regard.


  8. #8
    TheCanadian's Avatar
    Noo doot aboot it, eh?
    Yes it is easy to convert. You should try it and come back if you have a problem. I'm on my phone right now so I can't pass any links along but I know a google search will give you a lot of info.
    Proud Montanadian
    We tolerate living and breathing. And niches.

    Name Brand Watches

    Maybe getTimer() or TweenMax is the answer to your problem . . .

  9. #9
    Any way to solve this problem? I am still looking for help.


  10. #10
    Use a mask.

  11. #11
    Select the 'smk' movieclip that's on the stage and change its onClipEvent to this:

    onClipEvent (enterFrame) {
    	_alpha -= 0.3;
    	if (_alpha<50) {
    		_alpha -= 0.4;
    	if (_alpha<1) {
    	if ((this.getBounds(this._parent).yMin)-yspeed > 0){
    		_y = _y-yspeed;
    It's the last if statement that fixes it. It determines that if the top of the smoke particle will still be below stage top then it will allow it to move up. Otherwise it'll just leave it where it is and let the alpha drop to to <1.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012