18 Replies Latest reply on May 21, 2006 5:25 PM by Craig Grummitt

    what is this?

      hi again guys - i wanted to see if anyone could give me a quick answer to this question i have about my flash document. I don't need anyone to give me an explanation - just tell me what this is so I know where to look it up in my Flash tutorial book. Thanks

      I have a bunch of thumbnail images for my portfolio on the right and I want the user to click on one of those images and have a new image open up (which is the full version of the thumbnail) inside my white "frame" on the left. At the same time I want a new box to open up that is floating and hovering that has text in it that describes the image (i.e. this is a poster I
      designed for blah blah).

      I just don't know if that's a movie clip or a button event handler or what. I know it's an onrelease event but that's all I could figure out.

      you can view it here: (sorry no preloader yet) - just right click to stop it from looping - it's just my test verision


      thanks again!!

        • 1. Re: what is this?
          Craig Grummitt Level 3
          there are so many ways to achieve what you've described. i'm not sure exactly what you mean by floating and hovering. do you mean that the user can click and drag it to move around? or that it's moving on its own?

          i would start by designing this description box in a MovieClip. Depending on how well designed you want each individual description, I would either have a frame for each portfolio image description, or i would just design a generic description using a dynamic text field.

          Once you've designed this Movie Clip, right click on it in the library and select its linkage properties. select Export for Action-Script, give it an identifier. Now you can bring it in using the action-script attachMovie(...) at the appropriate time(when the portfolio image is clicked on i guess). At this stage, you would either goto the correct frame or fill the dynamic text field. Assuming 'floating and hovering' means you want the user to be able to move this description around, you would then give this movie clip onPress and onRelease event handlers with startDrag and stopDrag handlers respectively.

          oh, i hope i haven't filled in too much of the explanation so you can explore it a little yourself with your tutorial book! it's difficult to be general about a specific problem...

          good luck with it
          • 2. Re: what is this?
            epitomegirl13 Level 1
            Thanks so much Craig for your advice

            I guess I should start simple with this - I can't seem to figure out how to just click on one image on the right (the thumbnail) and get the larger image to display on the frame to the left when I click on the thumbnail.

            Like on this site http://www.scottjohnstonphotography.com/

            if you click on this guy's small thumbnail image on the right, it loads the corresponding bigger image on the left.

            I just want to figure out how that is done i.e. what that function is and then I will get complicated with floating oblects again thanks for your help.

            • 3. Re: what is this?
              TimSymons Level 1
              One way to set this up is to make a movieclip that will load images dynamically using the MovieClipLoader class. This will be where the larger images appear. Then on each of the thumbnails you will have to attach (either dynamically or manually) the name of the image you want to load. For example, this would be a very simple method for 2 thumbnails and 1 larger image display movieclip.

              var largeMC:MovieClip = _root.createEmptyMovieClip("large_mc", 1);
              var mcLoader:MovieClipLoader = new MovieClipLoader();
              largeMC._x = 0;
              largeMC._y = 0;
              // now assume that each thumbnail is a button you build dynamically or placed on the stage during authoring.

              thumb1.onRelease = function() {
              mcLoader.loadClip("large_image_1.jpg", largeMC);
              thumb2.onRelease = function() {
              mcLoader.loadClip("large_image_2.jpg", largeMC);

              Hope this helps a little.

              • 4. Re: what is this?
                Hi Tim & Carrie

                I have similar problem. As I don't have Photoshop, I imported my images into Flash 8, converted to Graphics & to buttons. Now the problem is how to access the image from the Flash library & then do the same as Carrie wants.

                thumb1.onRelease = function() {
                mcLoader.loadClip("large_image_1.jpg", largeMC); -------- // large_image_1.jpg must be in same dir as FLA file, but I wish to access my images from the library

                • 5. Re: what is this?
                  TimSymons Level 1
                  I think you add stuff from the library dynamically it has to be a movieclip. So you may have to convert each image into a movieclip and then set their properties to Export for ActionScript.

                  • 6. Re: what is this?
                    wandrer Level 1
                    Hi Tim

                    I found out that "BitmapData" can solve my problem (Flash Player 8). But the big problem is:
                    I have a combobox which goes to a particular frame (containing thumbnails). I have following code for calling frames from a ComboBox:

                    function onSelect() { //comboBox handler
                    gotoAndStop(paint_styl.getSelectedItem().data); // goto corresponding frame labels

                    The above code works fine with Flash Player 6 but not with Player 8. How to make it work with Player 8 as "BitmapData" works only with v.8 ?
                    Please help
                    • 7. what is this?
                      Craig Grummitt Level 3
                      it looks as though you may have left bits out of this code. for example the addeventlistener line doesn't refer to anything to listen to or what's listening to it...?

                      but you're right, the combo-box component syntax has changed from 6 - 8. check out help for more info. it does appear to be backward compatible though with getSelectedItem(), although this information is now accessed just a property - selectedItem.

                      So your code is very similar, the listener just needed work is all.

                      Craig (code following)

                      var cbListener:object = new Object();
                      cbListener.change = function(evt_obj:object) {
                      paint_styl.addEventListener("change", cbListener);
                      • 8. Re: what is this?
                        wandrer Level 1
                        Hi Craig,

                        Not working. I already tried it, but in vain ! Can you offer some more help?

                        • 9. Re: what is this?
                          Craig Grummitt Level 3
                          have you put a trace on what data you're receiving from the comboBox? Are you getting any error messages?
                          • 10. Re: what is this?
                            wandrer Level 1
                            How do I do that?
                            Sorry novice in programming

                            • 11. Re: what is this?
                              Craig Grummitt Level 3
                              temporarily replace the word gotoAndStop with trace. what appears in your output window will be the label that flash is trying to navigate to.

                              i asked if you were getting any error messages specifically when you export the swf, to see whether you have any duplicate frame labels.
                              • 12. Re: what is this?
                                wandrer Level 1
                                I have the above code, output window shows nothing !!!!
                                • 13. Re: what is this?
                                  Craig Grummitt Level 3
                                  it should show the item you have selected when selecting an item in your combo box...? if not, try replacing the trace line with:

                                  trace("selected - "+paint_styl.selectedItem.data);

                                  Also ensure that you actually have data in your combo box. click on your combo-box and double click on data. If you get it tracing what you're after then replace the trace with the following:

                                  • 14. Re: what is this?
                                    wandrer Level 1
                                    Not working !!!

                                    Do I need to reinstall Flash? Does anything goes inside the "Change Handler" Parameter of ComboBox properties?

                                    • 15. what is this?
                                      Flashygirl_UK Level 1
                                      hi epitomegirl99,
                                      Looks like you need to add stop(); to a new layer in your flash document because your swf document is looping!
                                      All the stop(); actionsript command does is stop the movie from looping like that. You should still be able to use the buttons.
                                      Hope this helps!
                                      I thought about your main problem and I thought, what abut using a button that on your mouse down tab when you edit the button you can put the whole picture in the frame. I assumed that you were going to use the frame next to the thumbnails to display the pictures.
                                      I looked at your page on the internet and it looks very good - well what I can see of it for the 2 seconds it displays for before looping.
                                      • 16. Re: what is this?
                                        Craig Grummitt Level 3
                                        Now i'm confused why your ComboBox has a "Change Handler" parameter?

                                        The only parameters my comboBox has are data, editable, labels and rowcount.

                                        i wouldn're reinstall flash just yet though. just go back a step - open a brand spanking new flash document. drag on the comboBox component from the components window(User Interface group). confirm the parameters that this comboBox has are similar to the parameters above. Add two or more data and labels fields. Give the comboBox the instance name 'paint_styl'. Add a new layer and add the action script attached to the first frame on this layer. Test the movie, select a line of the combo box which isn't already selected and the data should trace. If you do all that and it doesn't work, maybe you should post a link to your fla and we'll go from there.
                                        • 17. Re: what is this?
                                          wandrer Level 1
                                          Sorry.... my fault and thanks for the last comment ! That made me trace back what I actually did. I made the FLA in Flash MX 6 and opened it in v.8 .... thats why the proeblem. I deleted the combobox, and placed it again..... now everything works. A question:
                                          What is the use of eve_obj here? Why its declared if it is not used anywhere in the script- function(evt_obj : Object)?

                                          Are you from Asia Pac (Australia, New Zealand)? Coz I have seen you replying 1-3 in the morning CET (I am in Paris)

                                          Thanks for your support..... I am opening a new post by the name of Making work thumbnails (I think I got a reply of epitomegirl 99 - the originator of this post), I will be using BitmapData

                                          • 18. Re: what is this?
                                            Craig Grummitt Level 3
                                            yes good pickup pranay. the listener is automatically passed evt_obj as the object that triggered the change, and we could equally use this to target our combo box (probably makes more sense to do this too) eg..

                                            trace("selected - "+evt_obj.target.selectedItem.data);

                                            craig (in aus)