Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Having serious problem

  1. #1
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Having serious problem

    Hello guys,

    Ok I am aware there has been threads like this one before but I just cannot do the thing I need to do. Maybe with your help I might be able to solve the problem..

    Okei, what I want to do is to activate lightbox 2.04 by clicking on a button(s) from a flash file.

    I read a lot of threads about this, tryed a lot of stuff but it doesn't work.

    I'd really appreciate it if you guys can help me on this!

    Nicolas.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hey Nicolas,

    Have you seen my example here? If you haven't, download the source code and take a look. That particular example uses Lightbox++. I'm not aware of the differences in the code between the two versions -- only that Lightbox++ supports embedding Flash movies within the modal frame.

    If that doesn't help you, post your source files and/or relevant code, and we can troubleshoot your implementation.

    Add: Justin Lyric has a walkthrough to do the same on his blog.

  3. #3
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello Medyman,

    Thank you for the post!

    The thing I didn't specify was that I'm gonna import and use this flash movie in Dreamweaver cs3. So is this the only way (just codes in flash) or there is another easyer maybe way to do this in dreamweaver (and load the url from flash, as far as I understood)?

    thank you!

  4. #4
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok just in case I post my stuff here.

    /**Linked style**/
    <link href="lightbox.css" rel="stylesheet" type="text/css" />


    /**Scripts**/
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
    <script type="text/javascript" src="js/lightbox.js"></script>
    <script type="text/javascript" src="js/flashLightBoxInjector.js"></script>


    So my more specific question is how do I make a link to the flash button inside of the flash content. I thought about using spotlight but it can't work on flash content..

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Nicolas,

    Yes, the only way is by adding a script within Flash. Unless you have access to the .fla file and Adobe Flash, you won't be able to add actions to the button within Flash.

    There is a 30-day free trial of Adobe Flash CS3 available on Adobe's website, if you're interested.

  6. #6
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okei,

    I am sorry for my ignorance but where and what exacly should I change in this code (flash action script) to make it just to load the image as lightbox does it. I don't need the thumbnails nor the random picture funcition. I already have my buttons, all done. Just need to make it when I click to load as lighbox does..

  7. #7
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    The pertinent code to manually laucnhing Lightbox from within Flash is this:

    Code:
    Button.onRelease = function() {
    	getURL("javascript:LightboxDelegate('images/image.jpg','Image Caption')");
    }
    You would need to change the highlighted above. Button refers to the instance name of the button/movieclip in question. The code above is to be added to frame in the timeline.

    You also need to add the following JavaScript to your HTML page:
    Code:
    <script type="text/javascript">
       function LightboxDelegate(url,caption) {
       var objLink = document.createElement('a');
       objLink.setAttribute('href',url);
       objLink.setAttribute('rel','lightbox');
       objLink.setAttribute('title',caption);
       Lightbox.prototype.start(objLink);
    }
    </script>

  8. #8
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok so I add the code into a separate frame (not the button itself).

    About the HTML do I add all the normal lightbox code (what about the link? what do I put there) or just the code u wrote? because i just added this code (having the normal lightbox code ) but nthing worked.

    And one more thing.. when I activate the .swf file itself is something supposed to happen because when I press the button nothing happens..

    p.s.

    javascript:LightboxDelegate - is this supposed to be a file? I don't have this in my js folder

  9. #9
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    ok so I add the code into a separate frame (not the button itself).
    Correct. Though, you could add it to the button itself by using the on(release) syntax instead of Button.onRelease. However, that's not the proper way to code buttons so I don't recommend it

    About the HTML do I add all the normal lightbox code (what about the link? what do I put there) or just the code u wrote? because i just added this code (having the normal lightbox code ) but nthing worked.
    Have a look at my example page. View the source to see how everything is set up.

    And one more thing.. when I activate the .swf file itself is something supposed to happen because when I press the button nothing happens..
    Have you added the code WITHIN Flash? You'll need the button coded properly for anything to work. Make sure that Lightbox works without Flash before you start integrating Flash into it.

    I'm not sure what you mean by activating the .swf. Are you referring to the little dialog you get in IE? Or is there some sort of activation mechanism/animation in the Flash?

    javascript:LightboxDelegate - is this supposed to be a file? I don't have this in my js folder
    Again, refer to my page to see how it's done. You can insert it directly into the <head> of your page.

  10. #10
    Join Date
    Jun 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Allright i think my code in DW is set up properly.

    The thing is that when I see my page in brouser (safari and firefox) all the flash content (which i already imported into the page) dissapears. I really don't know what is this?

    When I said when I activate my .swf i meant like.. when I play it in flash and press the button nothing happens. I don't fully understand what you mean by within the flash. I just added the actionscript code into 1 separate frame (actions).

    I am really gratefull ur helping me!

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
  •