Change hover animation to click using actionscript 2.0...help

the following actionscript is for an accordion style menu which opens up when u hover on a particular area of the region...i wanted to change it to a clickable area....basically i want the accordion animation to start when i click on that particular region...any help would be appreciated...thanks a lot for your time....
stop();
speed = 10;
initial_width = 75;
target_width = 450;
sp = rect1._x;
this.createEmptyMovieClip("emptymc", 0);
emptymc.onEnterFrame = function() {   
for (i=1; i<=6; i++) {
    if (_root.hit.hitTest(_root._xmouse, _root._ymouse, true)) {
        if (_root["rect"+i].hitTest(_root._xmouse, _root._ymouse, true)) {
            new_x = (_root.sp-(75*(i-1)))-rect1._x;
            rect1._x += new_x/speed;
            n_width = target_width-_root["rect"+i]._width;
            _root["rect"+i]._width += n_width/speed;
        } else {
            n_width2 = initial_width-_root["rect"+i]._width;
            _root["rect"+i]._width += n_width2/speed;
    } else {
        new_x = _root.sp-rect1._x;
        rect1._x += new_x/(speed+50);
        n_width2 = initial_width-_root["rect"+i]._width;
        _root["rect"+i]._width += n_width2/(speed-1);
    _root["rect"+(i+1)]._x = _root["rect"+i]._x+_root["rect"+i]._width;
    _root["movie"+i]._x = _root["rect"+i]._x-1;
ps am also attaching the swf file so u can see for yourself how this works

If you want to changer the color of the text in the TextArea component you can use a TextFormat for that.  If your TextArea is named ta...
var myTF:TextFormat = new TextFormat();
myTF.color = 0x00FF00;  // primary green
ta.setStyle("textFormat",myTF);

Similar Messages

  • Multiple flash files change when a button click using javascript function

    hi.. am new in flsh...
    i want to multiple flash files change when a button click using a javascript

    <script>
    var count=0;
    function mafunct(newSrc){
        alert("hi");
    var path="a"+count+".swf"; 
    flash+='<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" WIDTH="100%" HEIGHT="100%">';         
        flash+='<PARAM NAME=movie VALUE="'+path+'">';         
        flash+='<PARAM NAME="PLAY" VALUE="false">'; 
        flash+='<PARAM NAME="LOOP" VALUE="false">';
        flash+='<PARAM NAME="QUALITY" VALUE="high">';
        flash+='<PARAM NAME="SCALE" VALUE="SHOWALL">';
        flash+='<EMBED NAME="testmovie" SRC="Menu.swf" WIDTH="100%" HEIGHT="100%"PLAY="false" LOOP="false" QUALITY="high" SCALE="SHOWALL"swLiveConnect="true"PLUGINSPAGE="http://www.macromedia.com/go/flashplayer/">';
        flash+='</EMBED>';
        flash+='</OBJECT>';    
    count++;
    alert(path+"aa");
    </script>
    <button onclick="mafunct()">next</button>

  • HELP! Displaying Text Randomly Every Time I Click using ActionScript 3.

    Hello! I'm doing a school project using Adobe Flash ActionScript 3. Here is an image of what I am working on:
    I have a text box layer on top of the talk bubble. At first it is blank, then I click on Hello Kitty and a random phrase pops up in the text box from the array I created. However, when I click her again she will not say another random phrase. I don't know what I'm doing wrong. Here is the code. Please, take a look at it and let me know what I can do to fix it! Thanks!
    var myPhrases:Array = new Array(); // HELLO KITTY PHRASES FOR TALK BUBBLE
    myPhrases[0]="My name is Hello Kitty!";
    myPhrases[1]="How are you today?";
    myPhrases[2]="Smile! It's a beautiful day!";
    myPhrases[3]="I want to be your friend!";
    myPhrases[4]="You have a great smile!";
    myPhrases[5]="I like flowers & rainbows.";
    myPhrases[6]="What is your name?";
    myPhrases[7]="Let's find Dora and go on an adventure!";
    myPhrases[8]="Mmmmeeeeoooowww!";
    var i:int=Math.floor(myPhrases.length*Math.random()); // RANDOM PHRASE
    var value=myPhrases[i];
    HKITTY_mc.addEventListener(MouseEvent.CLICK, onClick); // CHANGE PHRASE WHEN YOU CLICK ON HELLO KITTY (THIS IS NOT WORKING!!!!)
    function onClick(event:MouseEvent):void {
    stop();
    ILOVEMYTEXTBOX.text=value;

    If you just move those two lines of code into the function it will take care of things...
    function onClick(event:MouseEvent):void {
         var i:int=Math.floor(myPhrases.length*Math.random()); // RANDOM NUMBER
         var value=myPhrases[i];
         ILOVEMYTEXTBOX.text=value;
    which you could shorten to...
    function onClick(event:MouseEvent):void {
         ILOVEMYTEXTBOX.text=myPhrases[Math.floor(myPhrases.length*Math.random())];
    and you should be able to delete the duplicate post you have for this

  • When i go to photo stream on my apple tv it says the terms of service changed and i can't use it.  please help

    when i go to photo stream on my apple tv it says the terms of service have changed.  it wont let me view the photos.  please help.  where do i go to update the terms of service?

    I haven't seen that screen on my Apple TV's, however I think I may have seen something similar either at iCloud.com or in iPhoto but I don't recall too well, they may be places you might want to try.
    Have you updated your Apple TV to v 5.0, have you tried restarting it.

  • Track changes in business rule made using SOA composer

    Hi,
    I have business rules deployed on a server. Authorized user can change condition or any other thing in a business rule using soa composer. How can i track changes made in this business rule?
    i.e. I want to view the change and if possible who changes it.
    I am using SOA 11g
    Any help is appreciated
    Thanks

    Below document describes how to Monitor Decision Service Components and Engines.
    http://docs.oracle.com/cd/E29597_01/admin.1111/e10226/rules_mon.htm#CJAJJIJB

  • Newbie - how to change the color of a line using ActionScript?

    This must be the most basic question in the world, but I've
    been searching the documentation for an hour.
    All I want to do is to draw a line on the stage, and then
    change its color (or endpoint positions) dynamically using
    ActionScript.
    This is the 1st step to creating complicated dynamic
    animations... (No, I do not want to use the timeline, I want to do
    it dynamically.)
    Yet a line can't be an instance, so I'm confused -- how can I
    possibly do this? Is there some key concept I'm missing here?
    Thanks
    Michael

    AS2 required you to create your own function for doing
    primitive shapes. In AS3 that has changed and the graphics package
    includes not only the old AS2 drawing API but also has methods for
    doing squares, circles etc.
    If you are a VB programmer, my honest opinion is to leave
    your traditional OOP mindset at the door when using Flash.
    Actionscript is still in its infancy and although AS3 does really
    strive for OOP oneness, it isn't there 100% like VB is which has
    been around 20 years longer and gone through numerous additions
    etc. Whenever I learn a new language VB, PHP, C, AS, Java....I try
    my best to look at the language as its own identity. All language
    share similarities but they all have their own idiosyncrisies. Keep
    an open mind and you'll find what you need.
    Most of the seasoned guys here will also tell you that
    although the documentation is decent, you are better off going out
    and picking up a book on Flash 8/CS3 and another one on
    Actionscript. Familiarize yourself with the program that way.
    With your programming background, I'd recommend picking up
    Essential AS2 (or AS3) by Moock depending on your version of Flash.
    Also, if you are more interested in the programmatic side of Flash,
    why not look into Flex Builder and AIR. Since it is purely a
    programming environment (no Flash IDE), you'd be more
    comfortable.

  • How can I change Label's text using ActionScript?

    Hi~ everyone~
    I want change Label's text using ActionScript.
    Test.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="init()">
    <fx:Script>
      <![CDATA[
       private function init():void{
        var btn:BtnScript = new BtnScript();
        this.addElement(btn);
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label x="182" y="149" text="Label" id="lbl"/>
    </s:Application>
    BtnScript.as
    package
    import flash.events.MouseEvent;
    import mx.controls.Alert;
    import spark.components.Button;
    public class BtnScript extends Button
      public function BtnScript()
       super();
       this.addEventListener(MouseEvent.CLICK, eventHandler);
      private function eventHandler(event:MouseEvent):void{
              // lbl.text = "changed text";
           // HOW CAN I ACCESS LABEL IN MXML FILE?
    I'm about to learn flex. Please help me.
    Thanks in advanced.

    You could achive this very easily(but this shouldn't be used in production code as it'll be difficult to manage as the project grows) by defining a static data member varibale of DataType Label something like below, (modified/added code in BOLD)
    Test.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="init()"
          creationComplete="creationCompleteHandler(event)">
    <fx:Script>
      <![CDATA[
       private function init():void{
         var btn:BtnScript = new BtnScript();
         this.addElement(btn);
       private function creationCompleteHandler(event:FlexEvent):void{
         Model.someLabel = lbl;
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label x="182" y="149" text="Label" id="lbl"/>
    </s:Application>
    BtnScript.as
    package
      import flash.events.MouseEvent;
      import mx.controls.Alert;
      import spark.components.Button;
      public class BtnScript extends Button
        public function BtnScript()
          super();
          this.addEventListener(MouseEvent.CLICK, eventHandler);
        private function eventHandler(event:MouseEvent):void{
              // lbl.text = "changed text";
          // Now use Model.someLabel which is basically 'lbl'.
          Model.someLabel.text = "changed text";  //Mission Accomplished....
    Model.as
    package
      public class Model
        public static someLabel:Label;
    Note: This approach is just to give you an idea but instead should use the MVC pattern.

  • How do I change the default email software used when clicking on a link?

    When I click on a link to email a page to someone, it defaults to outlook which is not my default email software. How do I change this?

    Change the '''Action''' for '''''mailto''''' in the Applications tab of Options.
    [http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox]

  • Rollover animation and click combination problem

    Hey everyone....thanks in advance for the help
    I'm trying to edit an old Flash 8 in CS4, so I'm using AS2.0
    My problem is I have a menu bar that animates on screen from left to right on load
    and then it animates and plays a sound on rollover. I can't for the life of me get it to be able to hyperlink properly. I've gotten it to hyperlink on click, but then the rollover effect stops working. I've gotten it to hyperlink and rollover, but then the background covers up the graphics....it's frustrating the heck out of me!
    Any ideas would be greatly appreciated.

    change its timeline rollover/rollout animation to use actionscript only to animate it.

  • How to load other obejects in flash file after intro using ActionScript 3.0

    How to load other obejects in flash file after intro using ActionScript 3.0 or any other method all in same fla file. see blow intro screen shot ,this one playing repeatedly without loading other fla pages .only way to load other pages is click on Skip intro .see second screeshot below .i need that site to load after intro .
    see codes already in
    stop();
    skipintro_b.addEventListener(MouseEvent.CLICK, skipintro_b_clicked);
    function skipintro_b_clicked(e:MouseEvent):void{
    gotoAndStop("whoweare");
    There is another script there
    /* Simple Timer
    Displays a countdown timer in the Output panel until 30 seconds elapse.
    This code is a good place to start for creating timers for your own purposes.
    Instructions:
    1. To change the number of seconds in the timer, change the value 30 in the first line below to the number of seconds you want.
    var fl_TimerInstance:Timer = new Timer(1000, 30);
    fl_TimerInstance.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
    fl_TimerInstance.start();
    var fl_SecondsElapsed:Number = 1;
    function fl_TimerHandler(event:TimerEvent):void
              trace("Seconds elapsed: " + fl_SecondsElapsed);
              fl_SecondsElapsed++;
    i have no knowledge about these thing ,any help really appreciated .

    Ned Murphy Thank you very Much .It is working .Great advice

  • How to adjust the path of a tween using actionscript

    I'm a novice at Actionscript3 and would greatly appreciate an answer to what seems like a simple question:
    Here's my project:
    http://home.comcast.net/~samiri/director/mortals/amadoFlashPortrait/index.htm
    Click on the gray scale frame images. A larger version of that image tweens out along the z axis. However it comes from 'somewhere else' not from 'within the frame.' How do I get the each larger gray scale frame image to look like it comes directly from the place where the user clicks (not to one side or the other)?
    So I guess what I'm asking is how to adjust the path of the tween along the x and y axis using the actionscript code (below).
    My method:
    I'm using this line of code in my script:
    var myTween:Tween = new Tween(mdImg, "z", Strong.easeOut, 300, 0, 1, true);
    "mdImg" is the variable that holds the name of the hotspot clicked upon by the user.
    I have the larger (faded edge) image positioned directly on top of the frame image and just kept invisible until the User clicks on the hotspot over the frame image.
    Thanks much.

    Thanks moccamaximum,
    By "do your tweens manually" you mean to use the timeline to do frame-based tweening? That is an option but I'm wondering (as a newbie): Isn't it better to use actionscript to do animation since you have more control and it's time based rather than frame-rate based (and works better on low performance machines)? Just curious if I should be spending the time to learn actionscript or do it in the traditional way.
    Thanks

  • Use actionscript to trigger independant sound loop and reset

    Hello guys,
    I have a bit of experience with flash and actionscript, but due to the fact that I don't use it frequently, it happens that I forgot most of what I can do.
    I am about to start a sound project but I wanted to make sure it works before starting research.
    I want to use actionscript to click on letters that will display on the screen, and each letter will trigger an audio loop independantly, hence creating music.I also want to be able to reset the animation, erase all letters and sounds in order to restart. Actually that is the main question
    If it is possible, how ? Would you mind giving me some tips for a "kickstart"

    Is it possible, with flash to put different sounds triggered by a set of a buttons into a track and play this track in a loop ?
    I want to make it so when you press for example buttons A, then B, then C, it will play the sounds A, B and C respectively in an infinite loop. So when you click A, B, C, D, E, it will play ABCDE.
    EDIT: I succeeded ! I had to use arrays to do that. But now I would like that instead of putting the sounds automatically into the array at the beginning (red part), I want to be able to put by clicking on different buttons. It means if I click "A" first it will put the A into index 0, then B and put into index 1, then C and put into index 2, and so on. Also loop it indefinitely. How can ?
    var musicTrack = new Array();
    var aNote:a = new a();
    var bNote:b = new b();
    musicTrack.push(aNote);
    musicTrack.push(bNote);
    musicTrack.push(aNote);
    var musicChannel:SoundChannel;
    var currentSongIndex:int;
    function  onPlayBtnPressed() {
      currentSongIndex = 0;
      playSongFromIndex(currentSongIndex);
    function playSongFromIndex(songIndex:int) {
      musicChannel = musicTrack[songIndex].play();
      musicChannel.addEventListener(Event.SOUND_COMPLETE, songFinished);
      currentSongIndex++;
    function songFinished(e:Event) {
      if (currentSongIndex < musicTrack.length) {
           playSongFromIndex(currentSongIndex);
      } else  {
           currentSongIndex=0;
    onPlayBtnPressed();

  • By default, on a mac keyboard F3 lets you see all the open apps and the such. However, I changed it so that I use those keys for keyboard shortcuts; But i'd like the normal F3 key to still work without me having to press FN.

    By default, on a mac keyboard F3 lets you see all the open apps and the such. However, I changed it so that I use those keys for keyboard shortcuts; But i'd like the normal F3 key to still work without me having to press FN.

    rajlego,
    in the Keyboard pane of System Preferences, select the Shortcuts tab, and then select Mission Control on the left-hand side. On the right-hand side, make sure that the Mission Control checkbox is checked, double-click on its current key combination (by default “^↑”) so that the key combination is highlighted, and then press the F3 button — that will set its shortcut to be F3. You can now press F3 to bring up Mission Control without needing to also press the Fn button.

  • My Illustrator does not allow me to change colors using swatches panel. Help pleas.

    Few days ago I started having strange problems with my Illustrator CS5 application. I am using MacBook Pro with Intel Processor.  After major update on the Mac OS  few days ago  I noticed I can not change colors in my drawings using swatches panel. The function on my Illustrator CS5 stopped working.  When I select object and try to change its fill or stroke color using fill and stroke from the options bar above work space,  none of the swatches would work.  The are there how ever nothing hapends when I select them, the color remains the same.The same thing happens if I try to use the swatch panel, I select the object then I try to select new color from swatch but the fill or stroke does not change. I can only change color on my drawings using the color panel but that is not useful for me since I need to get precise colors using approved color swatches ether from pantone library or approved by client.
    The other strange thing is my selection tool does not deselect when I click outside on or of the artboard, the object remains selected until I reselect another object or use the keyboard short cut to deselect it.
    I have tried various options to resolve the issue from deleting and reseting preference to completely uninstalling and  reinstalling Illustrator CS5. I even installed back my old CS4 version because I had to complete a project  and the same issue is happens there as well. I also reset the application using Time Machine from few months ago when it was working correctly. What happens when I reset or reinstall the app, it works for  about 10 min correctly as it should and and then it reverts to the same problem. I am out of options and do not know what else I could  do to fix this. Right now I am working on my old Mac tower G5 and CS4 where everything works as it is suppose to, but I really need to get this fixed. Can any one help or has solution for my problem? Please.

    hey i m working on my illustrator and i m having many problems with my swatches
    for example i use the green phosphorique i don't get this color i get another green
    and many colors too it's like illustrator chooses for you the only green color
    so please i kind of need help i can show you pictures of that i print screen viewed them.. so anybody who can help... pleaaaaaaaaaase contact me because i m having a project now..
    my e mail is [email protected] i would be thankful
    i even tried to download the illustrator on my friend's computer also i m having this problem ....

  • After upgrading to FF 7. When I change my Privacy settings to Use custom settings and check ok, the changes are not saved.

    Using Win 7 sp1
    FireFox 7.0.1
    In Privacy Settings: When I change the FireFox will: to "use custom settings for history" and check ok, the setting isn't saved. After I close, then reopen the Privacy Settings tab, the setting for FireFox will: is back to "remember history"
    Thank you

    You can try to delete the cookies.sqlite and permissions.sqlite files in the Firefox profile folder.
    You can use this button to go to the currently used Firefox profile folder:
    *Help > Troubleshooting Information > Profile Director: Show Folder (Linux: Open Director; Mac: Show in Finder)
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    You can inspect and manage the permissions for the domain in the currently selected tab via these steps:
    *Click the "Site Identity Button" (globe/padlock) on the location bar
    *Click "More Information" to open "Tools > Page Info" with the Security tab selected
    *Go to the Permissions tab (Tools > Page Info > Permissions) to check the permissions for the domain in the currently selected tab
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • IPhoto 9.6 will not open in OSX Yosimite 10.10.2

    I'm using a MacBook Pro 15inch Early 2011 machine, 2GHz, 8GB RAM, OSX Yosimite 10.10.2. I have iPhoto version 9.6 and it will not open, just hangs up on the main screen with the little wheel spinning in the middle of it endlessly. No error messages.

  • PO distribution amount

    Hi, Is there any table from where I can get PO distribution amount? I checked table po_distributions_all where there were two columns 'amount_billed' and 'encumbered_amount'. I don't know which one to refer. Also can anyone tell correspondance betwee

  • CS3 Help Menu "Move Items" Dialog Box

    CS 3.0.1, WinXP Pro. When I open the Help menu, I get a dialog box called "Move Items." It lists folders and says, "Select the place where you want to move 'help.html' then click the Move button." I click Cancel, it comes up again, I hit Cancel, and

  • Duplicate items in launchpad?

    Upon starting with Lion, I noticed that the Launchpad has duplicates of some applications, such as iChat, DVD player, and FaceTime, to name a few. I want to remove the duplicate icons, but when I go to Library/Application Support there is no folder f

  • HT1937 I cannot set up my voice mailbox, I just go round and round with it, I want it in English and when I press one for English I get Spanish.

    When I tap on Phone/Voicemail I get taken to a screen that asks me to press one to have my voice mail in English and when I do it comes out in Spanish, on that second screen the word Greetings never appears.