-
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
-
Senior Member
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'.
-
Thanks for your resonse, I will open Flash and try using that.
-
How do I set up a sharedObject in Flash. I looked through the help menu, but it didn't seem very clear.
-
Senior Member
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...
-
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.
-
Senior Member
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.
-
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
-
Senior Member
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..
-
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
-
Senior Member
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.
-
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
-
Senior Member
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)
-
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
-
Senior Member
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?
-
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
-
oh btw.
Just to show you how noobish (again..even a word?) I am
could you please make it "autoplay"?:-)
Casper
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|