-
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
-
-
free-webmaster-resource.com
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
-
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
-
free-webmaster-resource.com
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
-
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
-
free-webmaster-resource.com
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
-
yesssssssssssss
i got it i have to use frame labels not frame numbers this was the problem, it is now working
thanks a lottttttttttttttttttttttttttt
-
free-webmaster-resource.com
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|