Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

link to specific frame in another swf not working 1

Status
Not open for further replies.

decibelle

Technical User
Feb 1, 2005
27
US
HERE'S WHAT I WANT TO DO

Click on a button in FILE_1.swf from PAGE_1.html. When the button is clicked, navigate to PAGE_2.html and display a specific frame from FILE_2.swf.



HERE ARE STEPS/CODE I'M USING

1. in the FILE_1.swf file, the first frame has this to set up the variable for the localconnection:

mySender = new LocalConnection();


2. on the PAGE_1.html file, name sure the page is identified with the local connection variable "mySender"

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" width="800" height="600" id="mySender" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="FILE_1.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="FILE_1.swf" quality="high" bgcolor="#000000" width="800" height="600" name="mySender" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" />
</object>


3. in the FILE_1.swf, the button PHOTO1_btn: for the "myConnections", perform "myAction" with the variable "2". Then go to the url specified below:
on (press) {
_root.mySender.send("myConnections", "myAction", 2);
}
on (release) {
getURL('PAGE_2.html');
}


4. on FILE_2.swf, create variable "myReceiver" for localconnection. from "myConnections", if the variable received is "2", perform "myAction" function and go to specific frame label "photo1".

myReceiver = new LocalConnection();
myReceiver.connect("myConnections");
myReceiver.myAction = function(doThis) {
if (doThis == 2) {
play();
gotoAndStop ("photo1");
}
}


HERE'S WHAT OCCURS
When I click on the PHOTO1_btn, I navigate to PAGE_2.html, *but* it does not go to the specified frame "photo1". Instead, it just goes to the first frame of FILE_2.swf file.

What am i missing?

Thanks so much for your help?????
 
Yes, page2.html replaces page1.html in the browser window.

 
How do i do that? can you please show an example? i'm still considered a beginner flash user *smile*

what i'm not sure about is if i use geturl:

getURL('PAGE_2.html');

where in the above can i pass the specific .swf file, then specify the variable?

thank you so much!!!!!
 
Unfortunately, yes, they have to be in separate html because they have different backgrounds.

However, if the same html was used how would you specify going to a frame in the 2nd swf?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top