A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Play Movie Only Once During Web Session

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    2

    Play Movie Only Once During Web Session

    Not sure if this is the right forum but, since I'm new to flash development, thought I'd start here. I want to play a movie (simple fade in text on top of a photo background) in a banner on my home page one time when the user first displays the home page. After that I'd like to have the end result of the movie (last frame) remain static for the remainder of the user's session, regardless of which pages they refresh. The only way I can see to do this within the web site configuration is to embed the swf on a main page, then display the contents of all the other pages in an iframe on that page. However, I would prefer not to rewrite the entire site to use iframes.

    I looked briefly at using a flash shared object and checking a variable in the swf onLoad event. But (I think) that requires the movie to be loaded to read the variable and hence the banner wouldn't show the text in the first frame. I could then jump to the last frame but it seems the banner would "flash" (sorry for the pun) from having no text at the start of the movie to displaying the text at the end every time a page is refreshed.

    I'm not sure if I can do what I want without using Action Script or if I need to control the whole process within the html on the page containing the embedded swf. I can probably dig around and figure out a solution if someone can point me in the right direction.

    Thanks in advance for any assistance.

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    bd,

    The sharedObject method is a very good method and is read and delivered rather quickly. I've used this method to determine the return of a user so they don't have to review a presentation for a second, third, infinite number of times.

    In your case, each time the user switches to another page, you don't want the header to play again, since they never left the site. I usually built those site in parts.

    Part one would be the base. This would contain the header, and the navigation section. I would also add any item that I want to remain static throughout the entire visit. This base would then load the pages (which I would be separately) into a section.

    When the user would click on a navigation button, the lower section (content section) would load the respective page and my "static" section (header, navigation) would remain the same.

    Now if you don't want to break up the site, or are concerned about the flash from the load of the header, I don't have a idea on how to perform what you're looking for.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    2
    Samac -
    Thanks for your reply. I think that's essentially what I figured I'd have to do using an iframe in the current product I'm using. I don't have much background in html so I'm using a wysiwyg development product that provides a master frame page with a content holder area for the remaining pages, but it refreshes the master frame objects every time a new page is presented in the content holder area. I may just have to bite the bullet, learn html and move to something more robust (although I don't think I'm up for DW) to get the control I'm looking for.

  4. #4
    Member
    Join Date
    Dec 2009
    Location
    Okanagan Valley, BC, Canada
    Posts
    33
    ... as a newbie to Flash myself, I was wondering the same thing. I'm fairly experienced in HTML and web building, but thought there may be a flash movie control for single playback on a visit to a site. I don't like to use iFrames unless I really have to, but in our forum environment (with the flash doc as our main banner/header) ... I may have to think about a slight re-build and iFrame usage, as I don't want the movie to replay with forum navigation.

    Kind Regards,
    Cal
    Researching, Visiting or Moving to the Okanagan Valley?
    www.okanaganforum.com

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