A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: urgent: two menus talk

  1. #1
    Member
    Join Date
    Oct 2003
    Posts
    34

    urgent: two menus talk

    hello,
    i want to have a horizontal menu which is made of flash, and it opens another vertical sub menu when a menu item is selected, each of the vertical and horizontal menus are in two different frames in a html file here is the code i use on the horizontal menu buttons
    Code:
     _root.soffers.gotoAndPlay(2);
    	_root.slogin.gotoAndStop(1);
    	_root.sjobs.gotoAndStop(1);
    where soffers and slogin and sjobs are movieclips found in the vertical menu which is in a different html frame in the page


    HOW can i do so as it is not working now
    thanks in advance

  2. #2
    Senior Member
    Join Date
    May 2000
    Location
    Bombay, India
    Posts
    926
    Hi.

    Check this if its of any help:

    http://www.macromedia.com/support/fl..._comm.htm#ftfc

    Tootles
    RanTen
    Unrepentant Rebel & Boat Rocker
    http://ranten.celltrix.com

  3. #3
    free-webmaster-resource.com deamothul's Avatar
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    1,475
    hi there, u can use a the localConnection Object 4 communicating between 2 swf's

    http://www.macromedia.com/support/fl...connection.htm

    i just ised it myself yesterday and it work perfectly

    laterz

  4. #4
    Member
    Join Date
    Oct 2003
    Posts
    34
    thanks,
    i can now send messages between two swfs,but i can't control a movie clip in the second file from the first one
    i have used this code in the sending flash
    Code:
      
    bcourses.onRelease = function() {
    	userMessage.text="courses";
    	outgoing_lc = new LocalConnection();
    	outgoing_lc.send("lc_name", "methodToExecute",userMessage.text);
    	delete outgoing_lc;
    };
    and that on the receiving one
    Code:
      
    incoming_lc = new LocalConnection();
    incoming_lc.methodToExecute = function(param) {
    	sentMessage.text = param;
    	_root.scourses.gotoAndPlay(2);
    	_root.soffers.gotoAndStop(1);
    };
    incoming_lc.connect("lc_name");
    the message is sent and does appear in the sentMessage but the movie clip is not responding,
    also i have tried this code on a movie clip


    Code:
      onClipEvent (enterFrame) {
    	if (sentMessage.text == courses) {
    		_root.scourses.gotoAndPlay(2);
    		_root.soffers.gotoAndStop(1);
    		
    	}
    }
    but it is also not working, i think the problem is in calling the movieclip can you help please
    thanks in advance

  5. #5
    free-webmaster-resource.com deamothul's Avatar
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    1,475
    hi there , i did it sorta like this with my file:
    in the sender swf
    Code:
    sendr = new LocalConnection();
    butonA.onPress=function(){
    sendr.send("Sender2Receiver","receiverFunction","unloader","loader");
    }
    In the receiver i had this:
    Code:
    receiver = new LocalConnection();
    receiver.receiverFunction = function(msg,msg2) {
    if(msg=="unloader"){
        home_container.unloadMovie()
       }
    if(msg2=="loader"){
       home_container.unloadMovie()
       home_container.loadMovie("newPage.swf");
       }
    }
    receiver.connect("Sender2Receiver");
    hope i had the code right
    laterz

  6. #6
    Member
    Join Date
    Oct 2003
    Posts
    34
    thanks loading movies is working with me
    but i don't want to load and unload movies
    i want to target (control) already existing movieclips, can u imagine how can i??
    thanks

  7. #7
    free-webmaster-resource.com deamothul's Avatar
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    1,475
    loading movies was just to show how it could be done.
    when i removed the piece of code that loads the movie , with something like: _root.gotoAndPlay("main")
    it went perfectly to the frame labeled "main" in the receiving swf

    I think you'll just have to play with it a bit , but i got it working with only replacing thst piece of code

  8. #8
    Member
    Join Date
    Oct 2003
    Posts
    34
    yesssssssssssss
    i got it i have to use frame labels not frame numbers this was the problem, it is now working
    thanks a lottttttttttttttttttttttttttt

  9. #9
    free-webmaster-resource.com deamothul's Avatar
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    1,475
    JIPPEEE

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