A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: Flash Header

  1. #1
    Junior Member
    Join Date
    Jul 2005
    Posts
    7

    Flash Header

    Im building an html site in dreamweaver, but I want to have a flash header. Im finding that after inserting the flash file, it restarts when I click to go to the next page in the navigation. Any way I can keep it constant while the rest of the page changes.

    Thanks for anty help!

    Sean

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    well if you are reloading a new page each 'click'..the new page loads..and starts the .swf loading again.

    what you'll have to do is:

    1.) inside the FLASH header make a SHARED OBJECT (flash cookie) that writes the "data" to the users computer (nothing more than say: header=played) upon loading of the index/hoe page.

    2.) also inside this header your going to have to:
    a.) check for this Shared Object on the users machine
    b.) check the data inside of it to see if the header should play again...or just be 'still'.

  3. #3
    Junior Member
    Join Date
    Jul 2005
    Posts
    7
    Thanks for your resonse, I will open Flash and try using that.

  4. #4
    Junior Member
    Join Date
    Jul 2005
    Posts
    7
    How do I set up a sharedObject in Flash. I looked through the help menu, but it didn't seem very clear.

  5. #5
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Its very easy to use.

    heres a quick example:
    1.) make a new .FLA
    2.) make 2 buttons & 2 textFields
    3.) 1 textField has INSTANCE (not var) name of save_txt the other has INSTANCE name of read_txt
    4.) move/label each button accordingly to work with each field (name the buttons save & read)
    on the SAVE button put this code:
    Code:
    on (press) {
            //create a new sharedObject called 'userName'
    	var mySharedObject:SharedObject = SharedObject.getLocal("userName");
            //assign (data) the sharedObject (mySharedObject) a var called 'name1', which has the value of whatever is in textField 'save_txt'
    	mySharedObject.data.name1 = save_txt.text;
            //write the data to the sharedObject
    	mySharedObject.flush();
    }
    on the READ button put this code:
    Code:
    on (press) {
            //load yoru sharedObject called 'userName'
    	var mySharedObject:SharedObject = SharedObject.getLocal("userName");
            //grab the variable 'name1' and put the VALUE in a textField called read_txt
    	read_txt.text = mySharedObject.data.name1;
    }
    all there is to it...

  6. #6
    Junior Member
    Join Date
    Jul 2006
    Posts
    2
    Hi Whispers,
    I have an mp3 player embedded in my flash header. This player needs to play continuously as the user navigates my html site.

    Would this 'flash cookie' allow me to accomplish this? If so, how?

    Blessings,

    -Davide
    Last edited by Rising_Suns; 07-31-2006 at 12:33 PM.

  7. #7
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    well, if you have an HTMNL page...with embeded FLASH movies.. everytime you load a NEW html the pages..the flash file will start over.

    Only thing I can think of is maybe using a sharedObject to write/save the NAME fo the second and where it left off playing..then when the new page reloads..it might be able to pick off where it left off.. however..continusouly playing will NOT work as far as I know...

    unless you are using a frame set..and only loading new HTML pages into the frame(s) and leaving the header/banner a constant.

  8. #8
    Junior Member
    Join Date
    Jul 2006
    Posts
    2
    Whispers,
    Thank you for the info. It looks like I will be forced to use framesets for this mp3 player, unfortunately.

    Thankfully though, the main drawbacks of framesets will *not* be exeprienced on the setup that I will be using. There will be no possiblity of "black holes", since the navigation and content will be in the same window. If search engines link to my content, then the only possible fault will be the absense of the mp3 player, rather than the absense of navigation (since the mp3 player will be in a frame by itself).

    I suppose the only nagging nusances left will be the bookmarking issue, i.e., any bookmarked page will autmatically load the home/index page....which is not entirely that big of a deal (my site will be only 2 levels, and <15 pages. So it won't be too much an an effort to return to a specified page).

    Am I forgetting anyting? Oh, printing. I will have to put a printing link in as well I guess.

    All in all, not too bad. I believe the benefit of having continous play, in my case, outweighs the hinderances.

    Thanks for the help. Perhaps sometime in the future Adobe will figure out the continous play issue.

    Blessings,

    -Davide

  9. #9
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    well....theres really nothing to figure out.
    if there is a flashplayer present...the movie (music) will play...if thre isnt one..thre is no music to play. so when you click a link in HTML it reloads a page...(hence no flash object)

    another solution would be to use CSS and a DIV layer (using the z-index) to lay your MP3 player OVER all exsisting HTML Pages.

    not 100% but it worth a shot to look into I suppose..

  10. #10
    Junior Member
    Join Date
    Nov 2007
    Posts
    5

    same problem:-)

    Hello

    I have the same problem. However I have previous had some success with the below code:

    --------------------

    stop();
    mySharedObject = SharedObject.getLocal("savedObject");
    _root.onLoad = function() {
    if (mySharedObject.data.visited) {
    _root.gotoAndStop(101);
    } else {
    mySharedObject.data.visited = true;
    mySharedObject.flush();
    result = mySharedObject.flush();
    if (result) {
    //all good
    } else if (!result) {
    //user at never -- prompt user
    System.showSettings(1);
    }
    _root.play();
    }
    };
    --------------------------------------

    This code has zero effect on this new and much more complicated flash moive/menu. Is there anyone who'd take a look at the fla file for me and make it work..really important:-)

    Regards,
    Casper

  11. #11
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    hi..

    the concept is the same.. you will still need to save/use a shared object.

    in my footer is alink on how to use one in its minimalest (even a word?) form..

    Im sure you can adapt that to your new/current project.

  12. #12
    Junior Member
    Join Date
    Nov 2007
    Posts
    5
    ok so what you are saying is I need something to "tricker" the effect.
    A button or and that creates this cookie, and then again something that will check the cookie?

    Is there no way to automate it?

    Sorry for the questions but I am a total noob, and in way over my head :-)

    Regards,
    Casper

  13. #13
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    yes.. more or less that is correct..

    however you do not need a button..that was just in the example.. it can happen as soon as the movie loads.. like any normal executing function.

    basically on load.. you check for cookie.. if not there you create one...

    same routine for each page. (its actually just one snippet of code in the same .fla)

  14. #14
    Junior Member
    Join Date
    Nov 2007
    Posts
    5
    yes.

    That's what I am looking for, I just cannot seem to make it work!:-(

    Would you be kind enough to put the code in the right place for me if I send you the .fla file? It would mean alot to me!

    Regards
    Casper

  15. #15
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    mean a lot to ya huh? LOL.. 'wishmaster'? can I wish for a million dollars?



    how big is the .fla? can you .zip and post (attach) it?

  16. #16
    Junior Member
    Join Date
    Nov 2007
    Posts
    5
    lol..you can wish all want;-)

    Sorry but Zip-file is 700k (yup a big one)..
    may I post a link to it? trying anyway so be quick!:-)

    click here for zip-file

    You can send it to me at
    casper6k4you@gmail.com

    Casper

  17. #17
    Junior Member
    Join Date
    Nov 2007
    Posts
    5
    oh btw.

    Just to show you how noobish (again..even a word?) I am
    could you please make it "autoplay"?:-)

    Casper

  18. #18
    Senior Member
    Join Date
    Sep 2006
    Posts
    225
    You could always use an <iframe> rather than a full frameset, it's a little more elegant, tho not too sure about how it fits in with standards and accessibility etc. Another option could be to use the 'zindex' of div layers with 'visibilty=' to show and hid the different pages of your site. this could be quite a nice option if the content of your site isn't very intensive from a loading point of view as it will all be loaded on the first page request.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center