Advanced Search

Results 1 to 9 of 9

Thread: Linking Flash Navigation Bar to Local HTML Pages

  1. #1
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Linking Flash Navigation Bar to Local HTML Pages

    Hey everybody. I've searched high and low for a solution to my problem, but I've found absolutely nothing that works. First of all, I am building a site for a client and I have the majority of the elements needed in place (css template, navigation bar swf, a few html pages, etc.) but I have not yet uploaded the site.

    My issue is, I have not been able to link my flash navigation bar to any of my local html pages. The published swf will work and link correctly (when tested within Flash), but when implemented into my html page (via DreamWeaver) it won't respond to the links at all. Perhaps the links won't be active until the site is uploaded or something? I'm not sure... which is why I'm here.

    Here's a segment of the code I've already written:

    Code:
    home_mc.addEventListener(MouseEvent.CLICK, hClick);
    
    function hClick(event:MouseEvent):void{
    	var homeLink:URLRequest = new URLRequest("home.html");
    	navigateToURL(homeLink, "_self");
    }
    Also, I have the Flash file and published swf in the same folder as the html pages.

    Can anyone offer me assistance? It would be much appreciated.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    I expect that would work. I'm not an expert with flash, but your basic approach is correct.
    Paths of course can be tricky, so the only way to test this is to upload everything to the server and try it for real. While you may work out some bugs testing locally, the situation may change significantly on the server, so you'll have to do it again anyway.
    This will also help users here to be able to answer your question better, if we can see the site.

    One thought that I had is this: is the location of the flash file the same as the swf files? Perhaps the relative path is based on the embedded flash file rather than the current page. I don't know how browsers/plugins parse this, so it might be worth wondering.

    When you say the links don't work, could this be for a reason outside of flash, such as an html element not allowing the user to access the swf?


    Finally, my simple recommendation is that you use absolute URLs. While it will be a little more work to maintain them (having to recompile the swf for any changes), it's more stable. And this, of course, should definitely work (unless there's some other unrelated problem).
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    First of all, thank you for the feedback.

    Yeah, I'll try uploading the site and maybe the swf will be able to connect to the html pages better. I'm just kind of baffled that it doesn't even try to open a new page when you click a button. It just sits there. : /

    As for the flash file being in the same location as the swf... yes. They are in the same folder and the html page in DreamWeaver is directed to the swf in that same folder. I'm not sure what you mean by this though:

    Perhaps the relative path is based on the embedded flash file rather than the current page.
    I suppose you're just saying that the html page is trying to take information from the actual flash file rather than the swf embedded into the html page.

    It could indeed be something external concerning the html (maybe the css properties for the div surrounding the swf?) but I'm not sure why it would affect this specific function of the navigation bar and not the others. I mean the mouse properties work fine on the navigation bar (hover, down, up, and out), so I don't know why it won't navigate to a new page when clicked.

    With your last suggestion, I suppose you mean
    "file:///C:/Users/Public/Church%20Website/Site/home.html"
    as the absolute URL instead of just "home.html"

    I have tried that as well, but still no luck. If you mean something different by "absolute URL" please let me know, and I will make the needed adjustments.

    Thanks again for your input. I'll definitely try uploading the site and see if that solves my problems. Hopefully that is the only issue! : )

  4. #4
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry for the double post, but I discovered something.

    I have not yet acquired the hosting information from my client, so the site has not been uploaded, but I did figure out that the site will link fine if the target is "_blank".

    As soon as I change it to "_self" to open it in the same window, the links are unresponsive. Has anyone experienced anything similar?

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    This is just a guess, but what happens if you try "_parent"?
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Aug 2007
    Location
    Harrisburg, PA
    Posts
    131
    Thanks
    6
    Thanked 9 Times in 9 Posts

    Default

    Are you testing locally? Within flash?

    If so since its just the flash player, there technically isn't a window, thats why _blank works, because it is actually opening the browser then. when you test in a full browser on a live server it should run fine.

  7. #7
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Figured it out actually. I really appreciate the input and help from you guys, though.

    It turns out that "_self" in swf objects doesn't play well with browsers. To remedy this you have to add a parameter to the swf in Dreamweaver.

    For anyone else that comes across this problem, here's the solution:

    "allowScriptAccess" "always"

    You can add it to the javascript code manually (which entails a bit more code), but I prefer to just do it through the add parameter feature in Dreamweaver.

  8. #8
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I need some help :/

    I'm curntly struggling with a similar issue, however, I am not very experienced. I currently have a flash design that encompasses the navigation bar, however, I can't seem to connect the flash navigation bar with the HTML content.

    How can I go about connecting the two?

    I would REALLY appreciate any help. Thanks guys.

  9. #9
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    229
    Thanks
    31
    Thanked 24 Times in 24 Posts

    Default Don't need target window

    I always thought FLASH navigation was bad because, if the viewer does not have Flash Player, you exclude that audience entirely.

    You can simply eliminate the target window since you want to navigateToURL() -- to go to that URL page. And make sure your MovieClip has button behavior.

    Code:
    home_mc.addEventListener(MouseEvent.CLICK, hClick);   
    
    function hClick(event:MouseEvent):void {
     	var homeLink:URLRequest = new URLRequest("home.html");
    	navigateToURL(homeLink); 
    }
    
    home_mc.buttonMode = true;
    You could also use optional shorter version.
    Code:
    home_mc.addEventListener(MouseEvent.CLICK, hClick);   
    
    function hClick(e:MouseEvent):void {
        navigateToURL(new URLRequest("home.html")); 
     }
    
    home_mc.buttonMode = true;

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
  •