A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: After a loadMovie(MovieA,_root.loadWindow); the action script of MovieA is not workin

Hybrid View

  1. #1
    Member
    Join Date
    Mar 2002
    Posts
    34
    Hello,

    I am coming back with my problem in case someone have not see it.

    My MovieA (who is loaded and opened in my root movie called MainMovie) include some ActionScript in order to display an image only if the mouse rollover a specific zone. (I am using the _xmouse and _ymouse with some condition in order to do that).

    I have loaded my movie using the following actionscript.

    loadMovie(MovieA,_root.loadWindow);

    This movie (MovieA) is working correctly when I launch it out of the MainMovie (In 'standalone'), but the thing is that it is not working when I load it in the MainMovie, the image is never displayed. Why ?

    What do I have to do in order to make its actionscript work correctly ?

    Attoc.


  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    The 'base timeline' has changed since you loaded the movie into _root.loadWindow. Any paths in the loaded movie have to reflect its new position. Either relative ('this' '_parent') or absolute (_root.loadWindow.mcname) As you see with abolute paths, you use the host's instance name as 'base timeline'.
    gparis

  3. #3
    Member
    Join Date
    Mar 2002
    Posts
    34

    I am sorry guys, but I must be stupid.


    Even with your help I still have not make it work.
    I give you more details. (I assure that is the last time :-))

    Using the following ActionScript, I am loading the 'Gallery2.swf' movie in the 'Index2.1.swf' movie:
    loadMovie ("gallery2.swf", _root.loadWindow);

    The 'Gallery2.swf' movie includes the following Scipt:

    x = _xmouse;
    y = _ymouse;
    Dist1 = Math.sqrt(Math.pow(Math.abs(_xmouse - 259.4),2) + Math.pow(Math.abs(_ymouse - 101.5),2));
    Rate1 = Dist1/60;
    if (x > 195.4 and y >49.5 and x <324 and y < 154 ) {
    scalex = (-90*Rate1) +90;
    setProperty ("/bichroblur+", _xscale, scalex);
    setProperty ("/bichroblur+", _yscale, scalex);
    } else {
    setProperty ("/bichroblur+", _xscale, 0);
    setProperty ("/bichroblur+", _yscale, 0);
    }
    gotoAndPlay (1);

    ('bichroblur+' is just a one frame movie clip with an image on it frame)

    Like you told me, I have tried with '_root.loadWindow.gallery2.bichroblur+' in my setProperty action but nothing.

    Thanks again.

    Attoc

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You do not need the 'name' of the movie. Just the instance name. Therefore your '/' referencing to the main timeline of the loading movie now is the instance name of the 'host'. So:
    _root.loadWindow.bichroblur should be good way to target instance bichroblur (I took off the '+' , not recomended in instance names)
    gparis

  5. #5
    Member
    Join Date
    Mar 2002
    Posts
    34

    Smile Ok !!!

    Thanks to all of you.

    And of course a special thanks to GPARIS.

    My last question (before the next one), are you from Paris ?

    Attoc.

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You're welcome. Yes I was born in Paris but now live and work in Montreal.
    gparis

  7. #7
    Member
    Join Date
    Mar 2002
    Posts
    34

    Great !!

    I am from France, I used to work in Paris.
    And (like you) I work now in Montreal.

    A la prochaine.

    Attoc.

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