Javascript button that loads a flash object on the fly - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Javascript button that loads a flash object on the fly

zanfardinomzanfardinom Posts: 4Member
Hey to all,

What I have in mind and was wondering if this will work or not. If so, could someone help me out. Thank you.

I have a page that's only one page with a left nav, top nav, and a main area. I just separated them with tables. In the main area I have a flash object that is noting but a loaded blank flash swf file. I only have code on each frame where I have a loadMovie() function to load a movie I want. So, the page stays the same and never changes, just the flash does. The way I do this is on the left nav buttons I have a method call or function call that takes a param, which is a number. And in the Javascrip function I tell the blank flash object to movie to that particular frame to load the newest movie. Hope this makes sense.

Ok, what I would like to do is just load the movie individualy using javascript and not just telling the fame to move. Is there a way to call a function from a click of a button say on the left nav and then have that function generate the object tags I need, really I would just pass in the file name and use that variable in the place where you would normally put the name of the flash file you are loading. And have this code display in my main section of the page. I got this to work except it would refresh the page and just display the flash object. Only if I hardcoded for the inital load of the page a file name it would work, but when I click on a button it refreshes the page and my left nave and top nave go away and the new flash object is created alone. Thank you for your time. I know this was long. Hope it makes sense.

Mdawg

Comments

  • WeirdofreakWeirdofreak Posts: 439Member
    I think I may have gathered something from it.

    I presume the button you use to change it is a submit input? You'll need to return false it, or it'll do the funcion, then do what submit buttons do best, which is send you to the page you tell it to, which is by default the page you are currently on.
  • zanfardinomzanfardinom Posts: 4Member
    Ok, so make my buttons a submit button that calls the function and the same page that I'm currenlty on. My buttons right now are images that were imported from fireworks. Will this work. Right now I got it to work but it refreshes the page and my left nav and top nav is on is gone but the flash oject loads. I want to keep my index.asp page and not send it to a diffent page each time like page1.htm or page2.htm. I just want the object of my flash to change and what I mean by change is display a different flash object. Like for example when the page is first visited, index.asp loads and in the content or body area I automatcialy call the function and it creates the object and passes in the filename home.swf. So, home.swf shows wiht my left nav and top nav. Then if the user clicks on the left nav button for pictures. I want it to call the same function but this time pass in a different name like pictures.swf. And what you see is the flash object has changed and again the left nav and top nav are still around it and we are still on index.asp. I can get the function to work when you first visit but once you click on a button it refreshes the page and all you see is the flash object like picturs.swf and not the left or top nav. Thank you for you help any more suggestions. Sorry for the long replys.

    mdawg

    : I think I may have gathered something from it.
    :
    : I presume the button you use to change it is a submit input? You'll need to return false it, or it'll do the funcion, then do what submit buttons do best, which is send you to the page you tell it to, which is by default the page you are currently on.
    :

Sign In or Register to comment.