A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Movie move to fron

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    314

    Movie move to fron

    how can I make a simple action script that when in the over state it shows another movie.

    Example, I want 2 movies to play at the same time and same location..but when in the over state, I want one to be hidden or vice vera...and the other to show !

    Thanks

    All ideas are welcome !
    Dijhili

  2. #2
    Member
    Join Date
    Feb 2006
    Posts
    96
    do you need something like this.....
    Code:
    a_mc.onRollOver = function() {
    	this._visible = false;
    	b_mc._visible = true;
    };
    b_mc.onRollOut = function() {
    	this._visible = false;
    	a_mc._visible = true;
    };

  3. #3
    Senior Member
    Join Date
    May 2001
    Posts
    314
    I think that is what I need...I will try that..

    Thank you very much sunny !
    Dijhili

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    314
    What does this mean ?

    **Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 1: Statement must appear within on handler
    a_mc.onRollOver = function() {

    **Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 5: Statement must appear within on handler
    b_mc.onRollOut = function() {

    Total ActionScript Errors: 2 Reported Errors: 2

    I have the 2 movies made as movie clips with names a_mc and B_mc
    Dijhili

  5. #5
    Member
    Join Date
    Feb 2006
    Posts
    96
    there should not be any error.. simply use my code with two movies of same size named a_mc and b_mc placed one over the other... the code should be written on main time line...

  6. #6
    Senior Member
    Join Date
    May 2001
    Posts
    314
    so 3 layer...one with the code on a keyfram and the other 2 layers has a_mc and then b_mc ?

    Thanks again
    Dijhili

  7. #7
    Member
    Join Date
    Feb 2006
    Posts
    96
    that will work.....

  8. #8
    Senior Member
    Join Date
    May 2001
    Posts
    314
    I think I got it !

    Thank you very much for your help.
    Dijhili

  9. #9
    Member
    Join Date
    Feb 2006
    Posts
    96
    I thank you also .. coz you have given me a nice idea that can be used for a couple of complementry effects...

  10. #10
    Senior Member
    Join Date
    May 2001
    Posts
    314


    Gee, glad I could help ! hehehe
    Dijhili

  11. #11
    Senior Member
    Join Date
    May 2001
    Posts
    314
    How can you add this same function to a button over states !
    Dijhili

  12. #12
    Senior Member
    Join Date
    May 2001
    Posts
    314
    Could it be something like this : ( i know it does not work...I am missing something)

    on (rollOver) = function() {
    this._visible = false;
    a_mc._visible = true;
    }

    on (rollOut) = function() {
    this._visible = false;
    b_mc._visible = true;
    }
    Dijhili

  13. #13
    Senior Member
    Join Date
    May 2001
    Posts
    314
    I made another movie clip and changed it around a little...and it works !

    over_mc.onRollOver = function() {
    a_mc._visible = false;
    b_mc._visible = true;
    };
    over_mc.onRollOut = function() {
    b_mc._visible = false;
    a_mc._visible = true;
    };


    thanks again
    Dijhili

  14. #14
    Member
    Join Date
    Feb 2006
    Posts
    96
    Code:
    on (rollOver) = function() {
    this._visible = false;
    a_mc._visible = true;
    }
    ... if you use this code on a button .. then "this" will not refer to the button but to the Movieclip in which the button is ... so if it is for say a button names a_btn .. then you must use it like ...
    Code:
    on(rollOver){
    this.a_btn._visible = false;
    }
    ...try this

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