A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: Mouseover Text enlarging and gallery help please

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

    Mouseover Text enlarging and gallery help please

    Hi all

    Firstly, hello to everyone.

    Ok, I have a question and would like some help with creating a flash gallery but for showing information rather than pictures. I will try to make this as clear as possible but if its confusing please let me know and I will give more details.

    Basically I trying to make a vertical timeline on the lefthand side with years (in text) which expand slightly on mousover and when clicked show the relavent information on the righthand side for that year.
    I can't seem to get the text to expand on mouseover? It would look like this:-



    If anyone could offer advice I would be most grateful.

    Thanks very much in advance.
    Kind regards
    Shiney

  2. #2
    Junior Member
    Join Date
    Dec 2009
    Posts
    11
    Hi Shiney09,

    you have to embed the font.

  3. #3
    Senior Member somlemeg's Avatar
    Join Date
    Aug 2000
    Posts
    171
    I'm not sure if the textField object supports mouseover. I think its easier if you create each year text in a movie clip, then create a function that is called when you move your mouse in your movie, that checks if the mouse is over one of the movie clips.

  4. #4
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Hi guys

    Thanks for the replies. I haven't tried to embed the font but I have tried making a movie clip but I am obviously not doing it right.
    I need the 2 actions, one is to enlarge when the mouse is over and one to show the information for that year on mouse click.

    I will keep trying and see if I can figure out what i am doing wrong but if you have any further ideas I would be grateful

    Thanks again
    Shiney.

  5. #5
    Senior Member somlemeg's Avatar
    Join Date
    Aug 2000
    Posts
    171
    I think the best way of doing it is naming each movie clip with years textfield in it as movY0, movY1, movY2 ...
    Then you create a script in frame 1 that runs when mouse move and clicks.

    PHP Code:
    yearTextFields 14;

    _root.onMouseMove=function(){
    // insert code here, mouse moves
    }
    _root.onMouseDown=function(){
    // insert code here, mouse click

    When the mouse moves you can cycle tru the text movie clips using the for function, and check if if the mouse is over using the hitTest function.

  6. #6
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Ok, I have managed to do this now with the movies. However I now have the problem that the information jumps up everytime i go into the workspace as this is grouped to the movie 1936??

    Any ideas how to "hide" the info until mouseover on that date or it is clicked??

    I have attached my swf file of the work so far.

    Thanks again.
    Last edited by Shiney09; 01-01-2010 at 09:52 AM.

  7. #7
    Senior Member somlemeg's Avatar
    Join Date
    Aug 2000
    Posts
    171
    I'm not sure if I understand what you mean.

    You mean in the workspace when working on the document in flash? You can use layers and hide them.

  8. #8
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Hi simlemeg

    No, if you look at the SWF I attached you have the dates on the lefthand side which move out with the mouseover and on the first 2 dates information is shown on the righthand side of the flash movie. BUT when you move the mouse over the whitespace (where the information would be) the first date pops up.
    So, if you click year 2000, the date stays out and show blank on the righthand side (no information), then move your mouse over the white area (where the information would show) and the information shows up for the first date?
    What I want to do is ONLY show this when the user scrolls over the date and/or clicks on it.

    I hope that makes a little sense?! ;-)

    Thanks
    Shiney

  9. #9
    Member
    Join Date
    Dec 2009
    Posts
    50
    I don't know your code, but it looks like you've made it appear by using the ".visible" property.
    I suggest either making it an "animation", so you make it appear by changing frames inside the movieclip, or (the better option in my opinion) you put it in a seperate movieclip to the year.

    What I think is going wrong; you have it in the same movieclip and made it invisible, but you have it set on rollOver, and the means that when you have your mouse over the info, visible or not, it will register that the mouse is over the top of THE movieclip, which contains both the year and the info.
    If it's not that, we probably need to see the code.

  10. #10
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Hi multihunter

    Thanks for your help too. I have put this in the same movie as the year which looking at this means that the rollover area becomes large and now includes the information bit not just the year.
    I have uploaded the .fla All the help is grately appreciated.

    Thanks again
    Shiney
    Last edited by Shiney09; 01-01-2010 at 09:52 AM.

  11. #11
    Member
    Join Date
    Dec 2009
    Posts
    50
    Right, so you did do an animation.
    A tiny bit of an overhaul is what I suggest.
    Take the animation of each "info" fading into existance and put it in it's own movieClip outside of any of the btn's. Then put code into the btn's that makes the info do what it did before.
    I used:
    PHP Code:
    function onEnterFrame() {
        
    _root.Yr1936info.gotoAndStop(_currentframe)

    I attached my edited version only doing the 1936 one in my suggested way. (EDIT: Which I just realised won't work on your version of Flash... So I just put the .swf there... sorry, unless you have Flash 8 or higher)

    I also renamed your "menu" to "menu1" because I think Flash has other uses for the word "menu" in the coding part. (It turns blue when you type it. Anything that turns blue when you type it I tend to avoid trying to use that word for naming something else)

    I'm going to see if I can find another way, but if you are happy with my suggestion...

    I have to ask. What's with the ".enabled"s? You don't have any actual buttons...

    EDIT: New option; you can just move the first frame of the animation of the fading info just one frame further in, just so that it's not in the first frame and can't be hit with the mouse... unless they hit it while it's fading out, so it's not as neat, but it CAN work.
    Last edited by Multihunter; 01-09-2010 at 04:28 AM. Reason: New option

  12. #12
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Hi Multihunter

    Brilliant, works perfectly thank you, very appreciated. I have just done 1938 and this works too ;-)
    I have one last question though, when you click the year for the information to stay fixed then scroll over the next year the info for that year shows too???
    Its not a massive issue however after making it work thus far it would be a little annoying to leave it.

    I have re-attached my fla with 1938 done so you can see what I mean.
    Any advice would be grately received.

    Thanks again
    Shiney.
    Last edited by Shiney09; 01-01-2010 at 09:52 AM.

  13. #13
    Member
    Join Date
    Dec 2009
    Posts
    50
    How about this?
    You put a variable in the root frame called "otherEnabled" or something.
    Start it being false, and then when you click something make it true. Then test if it's false, and if it is, then it should appear when the mouse is put over it
    PHP Code:
    function onEnterFrame() {
         if (
    _root.otherEnabled == false) {
               
    _root.Yr1936info.gotoAndStop(_currentframe);
         }

    Last edited by Multihunter; 12-31-2009 at 08:35 PM.

  14. #14
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Hi Multihunter

    Firstly Happy new year! Thanks for your reply, I have given this a whirl and cannot get it to work? Not sure if I need a stop function with it as it just repeats. What am i doing wrong?

    Sorry
    Thanks

  15. #15
    Member
    Join Date
    Dec 2009
    Posts
    50
    Happy New Year to you too!
    Ok, checklist!
    PHP Code:
    var otherEnabled:Boolean false
    //goes in root frame. Name it whatever you like, but I'm using this

    mc.onRelease = function() {
    _root.otherEnabled true
    }
    //just add the code inside that function there to the one in the frame in "menu"

    function onEnterFrame() { 
         if (
    _root.otherEnabled == false) { 
               
    _root.Yr1936info.gotoAndStop(_currentframe); 
         } 
    }
    //goes into the button in a frame that is the length of the entire movieClip 
    (My bet is that skipped the second one there...)

  16. #16
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    I'm really confused. Have you got it working? I added var otherEnabled:Boolean = false to the root frame.

    this one to the menu frame

    mc.onRelease = function() {
    _root.otherEnabled = true
    }

    and this one to the actual 1936 button actions to replace the other code I have in there.

    function onEnterFrame() {
    if (_root.otherEnabled == false) {
    _root.Yr1936info.gotoAndStop(_currentframe);
    }
    }

    I have done the same for 1938 too but obviously changing the name. I assume I would only have to add the first 2 once and the 3rd on into each button.

  17. #17
    Member
    Join Date
    Dec 2009
    Posts
    50
    I've got it working. Your assumption is correct.

    So long as otherEnabled is false, it will fade the infos in and out. (Are you using "otherEnabled"?)
    If otherEnabled is true, then it won't.
    So you want to make it true when the user clicks on a date.
    You currently have code for when the user clicks on a date, so you have to put the changing of the Boolean inside that function.
    If you are sure that you have done this, then I think you might have to post what you have done so far in a .fla...
    This is your project, though. An answer you came up with will always be better than one I have for you.

  18. #18
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    Ok, done the checklist and have attached the .fla
    This will be the last one as appreciate you have better things to do ;-)

    Your help has been gratefully received though.

    If i can't get it working then I will have to come up with something else.

    Any last pointers?!

    Thanks
    Attached Files Attached Files

  19. #19
    Member
    Join Date
    Dec 2009
    Posts
    50
    -_-
    c'mon man...
    PHP Code:
    mc.onRelease = function() {    
            
    _root.otherEnabled true
    }
    mc.onRelease = function() {            
                
            
    $mc["btn"+$mc.currItemSelected].enabled true;   
            
    $mc["btn"+$mc.currItemSelected].gotoAndPlay(11);
                

                
            
    $mc.currItemSelected this.no;
                
            
    this.enabled false;
            
    this.gotoAndStop(10);

    Think about it... what's wrong with this?
    ... if you still don't know; here's what it should look like;
    PHP Code:
    mc.onRelease = function() {    
            
    _root.otherEnabled true    
            $mc
    ["btn"+$mc.currItemSelected].enabled true;   
            
    $mc["btn"+$mc.currItemSelected].gotoAndPlay(11);
                

                
            
    $mc.currItemSelected this.no;
                
            
    this.enabled false;
            
    this.gotoAndStop(10);
        } 
    (Yes, I have tested it. That IS your problem)

    EDIT: You'll also have to add:
    PHP Code:
    _root.Yr1936info.gotoAndStop(_currentframe); 
    to frame 10 of each of the buttons, with the relevant names of course

    Curses... bear with me....
    Last edited by Multihunter; 01-01-2010 at 10:13 AM. Reason: Additional information

  20. #20
    Junior Member
    Join Date
    Dec 2009
    Posts
    16
    oops, i forgot to take that out.
    I have corrected it but it still doesnt work.

    Thanks anyway for all your help

    All the best
    Shiney

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