Accessing a Control on a Framed page - How? 
Author Message
 Accessing a Control on a Framed page - How?

I have a frame page on my site that has two frames. One frame is named music and the other frame is named content. I have a control on the page in the music frame that I would like to control from the page in the content frame. Currently I am using VBScript but I would also like to be able to do this with JavaScript. I know that JavaScript has a document property called parent that should allow me to get to the control using document.parent.music.CONTROL ? Is this correct ? If not, how would I access the control in VBScript, and what is the syntax for accessing it using JavaScript ?

Thanks
Gregory I. Hayes

http://www.*-*-*.com/



Wed, 01 Aug 2001 03:00:00 GMT  
 Accessing a Control on a Framed page - How?

parent.music.CONTROL will do it

--
Best Regards
   Vidar Petursson
http://www.icysoft.com

I have a frame page on my site that has two frames. One frame is named music
and the other frame is named content. I have a control on the page in the
music frame that I would like to control from the page in the content frame.
Currently I am using VBScript but I would also like to be able to do this
with JavaScript. I know that JavaScript has a document property called
parent that should allow me to get to the control using
document.parent.music.CONTROL ? Is this correct ? If not, how would I access
the control in VBScript, and what is the syntax for accessing it using
JavaScript ?

Thanks
Gregory I. Hayes

http://emall-usa.com/greg



Thu, 02 Aug 2001 03:00:00 GMT  
 Accessing a Control on a Framed page - How?
<Newsgroups trimmed a bit...>


Quote:
>It does not work even though I am referencing it via parent.FRAME.CONTROL.
>The error would seem to indicate that the control cannot be found.
>Is the problem something I am not doing or the control?

Hi,

You have two problems (at least).

The first one, which is your VBScript error, is easy to fix. The problem was
that you had multiple references to "MC" in your code, but you were only
qualifying the first one (ie, the one at the start of the line). It is
easier if you create a global variable that refers to the control (as I have
done below) and then refer to that:

    <script language="VBScript">
    Dim oControl
    Set oControl = window.top.frames("MUSIC").MC

    Function start_piano()
        oControl.EZPlaySection "C:\Multimedia Files\Music\Interactive
Music\heartlnd.sty", _
            "C:\Multimedia Files\Music\Interactive Music\herb1b.per", 64, _
            oControl.C_FILL, "Electric Piano", oControl.S_RISING, 1, TRUE
        timerOne=setTimeout("start_default()", 20000, "VBScript")
        oControl.PlayMotif "organ", oControl.F_MEASURES_FROM_NOW, 2
    End Function

    'Make the same modifications to the other functions

    </script>

The second problem is that you are referring to local paths ("C:\Multimedia
Files\etc...") but will people have these files installed on their computer?
Most likely not. You should be using a URL back to your website (if this is
possible).

Peter

--
Peter Torr, Developer / Webmaster, Vantage Systems Australia.



Fri, 03 Aug 2001 03:00:00 GMT  
 Accessing a Control on a Framed page - How?
Thanks tons Peter. I've fixed both problems and it works beautifully! The referencing of the music files on my drive was an oversite on my part, I know better, but didn't notice it because I was testing on my machine. I plan on using the technique at http://emall-usa.com/rampart and at http://emall-usa.com/greg (my personal site)

Again, Thanks.
Gregory I. Hayes

|<Newsgroups trimmed a bit...>
|

|>It does not work even though I am referencing it via parent.FRAME.CONTROL.
|>The error would seem to indicate that the control cannot be found.
|>Is the problem something I am not doing or the control?
|
|Hi,
|
|You have two problems (at least).
|
|The first one, which is your VBScript error, is easy to fix. The problem was
|that you had multiple references to "MC" in your code, but you were only
|qualifying the first one (ie, the one at the start of the line). It is
|easier if you create a global variable that refers to the control (as I have
|done below) and then refer to that:
|
|    <script language="VBScript">
|    Dim oControl
|    Set oControl = window.top.frames("MUSIC").MC
|
|    Function start_piano()
|        oControl.EZPlaySection "C:\Multimedia Files\Music\Interactive
|Music\heartlnd.sty", _
|            "C:\Multimedia Files\Music\Interactive Music\herb1b.per", 64, _
|            oControl.C_FILL, "Electric Piano", oControl.S_RISING, 1, TRUE
|        timerOne=setTimeout("start_default()", 20000, "VBScript")
|        oControl.PlayMotif "organ", oControl.F_MEASURES_FROM_NOW, 2
|    End Function
|
|    'Make the same modifications to the other functions
|
|    </script>
|
|The second problem is that you are referring to local paths ("C:\Multimedia
|Files\etc...") but will people have these files installed on their computer?
|Most likely not. You should be using a URL back to your website (if this is
|possible).
|
|Peter
|
|--
|Peter Torr, Developer / Webmaster, Vantage Systems Australia.

|
|



Fri, 03 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Accessing a Control on a Framed page - How?

2. Accessing a Control on a Framed page - How?

3. accessing controls in a different frame on same page

4. Chosing Frame content in a 2 framed page from a 1 framed page

5. Prevent page access outside of frame

6. FRAMES - NonFrame page to Frame page

7. Accessing controls on Compose Page vs Read Page

8. Controlling access to certain web pages

9. Need Help Manipulating a control on an Embedded Data Access Page

10. Change control source in a data access page

11. Controlling Frame Width from Another Frame

12. setfocus inside a frame control from outside the frame

 

 
Powered by phpBB® Forum Software