Page 5 of 5 FirstFirst ... 345
Results 41 to 44 of 44

Thread: changing iframe content with flash buttons

  1. #41
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    That would be done in Flash.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  2. #42
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by BLiZZaRD View Post
    That would be done in Flash.
    I see, is there no solution for this in Dreamweaver then?

    Thanks.

  3. #43
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    The short answer is no. If you have access to the .fla then there is a work around, FlashVars can help, but you would still need access to the fla file to add the variables to call to/from.

    I take it there is no chance of getting the fla to work with huh?
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  4. #44
    Join Date
    Feb 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Flash player security (version 8 +)

    I'm no guru, but using the suggested :

    getURL("myURL", "Iframe_name")

    ...when the testing files were on my local machine - opened a new browser window with the referenced content. When the files were moved to a web server - it works as it's supposed to. Due to security limitations in the flash player, I think that when testing on a local file system root domains get a tad mixed up.

    I have implemented the above process without Iframes using an adaptation of the Dynamic Ajax Content article posted at :

    http://www.dynamicdrive.com/dynamici...jaxcontent.htm.

    It was real easy using a div container which is much more versatile instead of an Iframe (this also has to be on a webserver and won't work on a local file system).

    Read the article, but if you are in a rush here is the code I used:

    1) To the head section of your main document ->

    <script type="text/javascript">

    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname

    function ajaxpage(url, containerid){
    var page_request = false
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else
    return false
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    page_request.open('GET', url, true)
    page_request.send(null)
    }

    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }

    function loadobjs(){
    if (!document.getElementById)
    return
    for (i=0; i<arguments.length; i++){
    var file=arguments[i]
    var fileref=""
    if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
    if (file.indexOf(".js")!=-1){ //If object is a js file
    fileref=document.createElement('script')
    fileref.setAttribute("type","text/javascript");
    fileref.setAttribute("src", file);
    }
    else if (file.indexOf(".css")!=-1){ //If object is a css file
    fileref=document.createElement("link")
    fileref.setAttribute("rel", "stylesheet");
    fileref.setAttribute("type", "text/css");
    fileref.setAttribute("href", file);
    }
    }
    if (fileref!=""){
    document.getElementsByTagName("head").item(0).appendChild(fileref)
    loadedobjects+=file+" " //Remember this object as being already added to page
    }
    }
    }
    </script>

    2) Then some styling for you div tag:

    <style type="text/css">

    #rightcolumn{
    float:left;
    width:450px;
    min-height: 400px;
    border: 0;
    margin-left: 10px;
    padding: 5px;
    padding-bottom: 8px;
    }
    </style>


    3) And then in the body tag I put :

    <body onload="ajaxpage('frames/home.html', 'rightcolumn'); javascript:loadobjs('css/aqua.css');">

    Just to initialise my css file and some content for the div container.


    4) Placed my div container in the html body:

    <div id="rightcolumn"><h3>Page loads here</h3>


    5) On my flash buttons (the nav) I used the following code:

    on (release) {
    var divURL:String = "frames/awards.html";
    getURL("javascript:ajaxpage('"+String(divURL)+"', 'rightcolumn');");
    }

    Hope this helps - visit the link http://www.dynamicdrive.com/dynamici...jaxcontent.htm for a complete explanantion/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •