SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jan 2001
    Location
    WA
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Loading a Flash movie with Javascript

    I need btn_web.gif button to load a flash movie on it's mouse over (done in Javascript). Is this even possible?

    I'm not very familiar with Javascript but I need something like this (i have the rollover down just need some help with the other part of the code):
    ...
    <SCRIPT language="javascript">
    function highlightButton(imgNum,imgSrc) {
    document.images[imgNum].src = imgSrc;
    }
    call flash movie here with some Javascript code
    </SCRIPT>
    </head>
    <body>
    <a href=""
    onMouseOver="highlightButton(0, 'images/btn_web1.gif'); LoadtheFlashMovie(call the specified funtion)"
    onMouseOut ="highlightButton(0, 'images/btn_web0.gif');>
    <img src="images/btn_web.gif" border=0 width=218 height=15></a>

  2. #2
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suppose it's possible, but I doubt it would be very well supported in most browsers. See, you'd have to use the DOM to delete the image, then insert all the flash code. However, it would then be impossible to know when you moused out of the flash and switch things back. I'm not 100% sure on this, but that's how it seems to me. So you could get a rollover that rolled over once and wouldn't work on many browsers. Why not just make the whole thing a flash movie and save yourself the trouble?
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  3. #3
    SitePoint Member
    Join Date
    Jan 2001
    Location
    WA
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I did that at first (all in flash) but I couldn't get my button to keep it's anti-aliased look that it had before I imported into flash. In flash it looked like a bitmap. It didn't fit with my design.
    Thanks for the advice.

  4. #4
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't imagine it would look any different in flash than in HTML... I mean, it's the same image. Is it being stretched? If so, you might need to turn smoothing on for that bitmap in the Library. Oh, maybe you need to tweak the compression settings (if you want it to look best, use PNG), again in the Library settings for that image.
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/

  5. #5
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    Posts
    468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd be interested to see the flash file, and the image. I'm convinced they should look the same.
    Web Design:
    http://www.numbera.com/
    Free Web Design Resources and Software:
    http://brh.numbera.com/


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
  •