AS3.0 code for tooltip

Hello, I'm able to find AS2.0 code for a tooltip, but can't seem to find a simple one for AS3.0.
When the pointer hovers over a point on the map, a tooltip appears with the name of the city. I need to be able to change the city name depending on the point.
I appreciate anyone's help!

// create one buttonObj for all your buttons
var buttonObj:Object={};
//////////////////////////////////////change nothing above ////////////////////////////////////
//the next 3 lines need to be done for all your buttons
buttonObj[yourbutton.name] = ["hello",2,2];
yourbutton.addEventListener(MouseEvent.MOUSE_OVER,addToolTipF) ;
yourbutton.addEventListener(MouseEvent.MOUSE_OUT, removeToolTipF);
////////////////////////////////////change nothing below/////////////////////////
function addToolTipF(e:MouseEvent):void{
var a:Array = buttonObj[e.currentTarget.name];
var tf:TextField=new TextField();
buttonObj[e.currentTarget.name].push(tf);
tf.text=a[0];
tf.multiline=false;
tf.autoSize="left";
tf.border=true;
addChild(tf);
tf.x=a[1]+e.currentTarget.x;
tf.y=a[2]+e.currentTarget.y;
function removeToolTipF(e:MouseEvent):void{
removeChild(buttonObj[e.currentTarget.name][3]);
buttonObj[e.currentTarget.name].splice(3,1);

Similar Messages

  • Would someone be willing to check as3 code for a guestbook

    Would someone be willing to check out some as3 code for a guestbook? I'm an old person, and can't seem to get it working.
    Thanks!

    Ned suggested that I post the code, so everyone could see it. The SWF works, but the code doesn't. Any help appreciated!
    package com.mgraph\
      //IMPORTS
      import flash.display.Loader;
      import flash.display.MovieClip;
      import flash.display.Sprite;
      import flash.display.StageAlign;
      import flash.display.StageScaleMode;
      import flash.events::EventDispatcher/dispatchEventFunction();
      import flash.events::EventDispatcher/dispatchEvent();
      import flash.events.MouseEvent;
      import flash.events.TextEvent;
      import flash.events.KeyboardEvent;
      import flash.geom.Rectangle;
      import flash.net::URLLoader/onComplete();
      import flash.net.URLRequest;
      import flash.net.URLRequestMethod;
      import flash.net.URLVariables;
      import flash.text.TextFieldAutoSize;
      import flash.text.TextFormat;
      import com.utils.StringUtils;
      import com.caurina.transitions.Tweener;
      import com.pageflip.Page;
      import com.pageflip.PageEvent;
      public class Guestbook extends MovieClip {
      //PRIVATE VARS
      private var myXML:XML;
      private var frm:TextFormat;
      private var popup_mc:MovieClip;
      private var greySprite:Sprite;
      private var initPosition:Number;
      private var dy:Number;
      private var initContentPos:Number;
      private var moveVal:Number;
      private var rectScroll:Rectangle;
      private var stageWidth:Number;
      private var stageHeight:Number;
      public function Guestbook(){
      addEventListener(Event.ADDED_TO_STAGE,init);
      private function init(e:Event):void {
      stage.showDefaultContextMenu = false;
      stage.align = StageAlign.TOP_LEFT;
      stage.scaleMode = StageScaleMode.NO_SCALE;
      stageWidth = stage.stageWidth;
      stageHeight = stage.stageHeight;
      // LOAD THE XML
      var xmlPath:String;
      var xmlLoader:URLLoader = new URLLoader;
      if (root.loaderInfo.parameters.myconfig) {
      // XML PATH FROM HTML flashvars (myconfig)
      xmlPath = root.loaderInfo.parameters.myconfig;
      else {
      // DEFAUL PATH OF XML
      xmlPath = "config.xml";
      xmlLoader.load(new URLRequest(xmlPath));
      xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
      private function xmlLoaded(e:Event):void {
      // XML LOADED COMPLETE
      myXML = new XML(e.target.data);
      // ADD EVENT LISENER TO FIELDS AND TO (send_btn)
      form_mc.name_txt.addEventListener(TextEvent.TEXT_INPUT,clearAlert);
      form_mc.email_txt.addEventListener(TextEvent.TEXT_INPUT,clearAlert);
      form_mc.message_txt.addEventListener(TextEvent.TEXT_INPUT,clearAlert);
      form_mc.email_txt.addEventListener(Event.CHANGE,checkMail);
      addMouseEvent(form_mc.send_btn,sendEvent);
      // CREATE TEXT FORMAT (frm)
      frm = new TextFormat  ;
      frm.leading = 4;
      form_mc.message_txt.defaultTextFormat = frm;
      // LOAD BACKGROUND IMAGE
      var backLoader:Loader = new Loader();
      backLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,backLoaded);
      backLoader.load(new URLRequest(myXML.img_back));
      // ADD KEYBOARD EVENT WHEN PRESSING ENTER KEY
      stage.addEventListener(KeyboardEvent.KEY_DOWN,keyboardDown);
      // CREATE THE GREY SPRITE
      greySprite = new Sprite  ;
      greySprite.graphics.beginFill(0x000000,0.2);
      greySprite.graphics.drawRect(0,0,stageWidth,stageHeight);
      greySprite.graphics.endFill();
      greySprite.useHandCursor = false;
      // CREATE THE POPUP and ADD EVENTLISTENER TO (close_btn)
      popup_mc = new popup_obj;
      popup_mc.x = (stageWidth - popup_mc.width)/2;
      popup_mc.y = (stageHeight - popup_mc.height)/2;
      addMouseEvent(popup_mc.close_btn,closeEvent);
      private function keyboardDown(e:KeyboardEvent):void{
      if(e.keyCode == 13){
      // STOP USING BREAK LINE IN message_txt
      stage.focus = null;
      private function backLoaded(e:Event):void{
      // BACKGROUND LOADED COMPLETE
      var back_mc:MovieClip = new MovieClip;
      back_mc.addChild(e.target.content);
      addChildAt(back_mc,0);
      form_mc.wait_mc.visible = false;
      startPageFlip();
      // START LOADING GUEST MESSAGE FROM DATABASE
      load_guestbook();
      private function startPageFlip():void{
      var flipedPage:Page = new Page(this, stageWidth, stageHeight, 0, 0);
      flipedPage.turnPageForward();
      private function load_guestbook():void {
      // GET MESSAGES FROM DATABASE USING PHP
      var guestLoad:URLLoader = new URLLoader  ;
      var guestReq:URLRequest = new URLRequest(myXML.phpURL);
      guestReq.method = URLRequestMethod.POST;
      guestReq.data = new URLVariables  ;
      guestReq.data["getMessage"] = 1;
      guestLoad.addEventListener(Event.COMPLETE,bookLoaded);
      guestLoad.load(guestReq);
      private function bookLoaded(e:Event):void {
      // MESSAGES LOADED SUCCESSFULLY FROM DATABASE
      var bookXML:XML = new XML(e.target.data);
      showMessages(bookXML);
      private function showMessages(_xml:XML):void{
      var guest_mc:MovieClip;
      // CREATE (guest_mc) to SHOW EACH GUEST NAME & MESSSAGE
      for (var u=0; u<_xml.guest.length(); u++) {
      guest_mc = new messageObj  ;
      guest_mc.y = 95 * u;
      //CAPITALIZE THE FIRST CHAR IN NAME
      guest_mc._Name = StringUtils.capitalize(_xml.guest[u].name);
      guest_mc._Msg = _xml.guest[u].msg;
      guest_mc._Date = _xml.guest[u].sdate;
      guest_mc.guestName_txt.htmlText = setHtmlFormat(14,myXML.name_color,guest_mc._Name);
      //IF guestMessage_txt TEXT LENGTH > 110 substr guestMessage_txt AND ADD (...)
      guest_mc.guestMessage_txt.htmlText = setHtmlFormat(12,myXML.message_color,StringUtils.capitalize(StringUtils.truncate(_xml.gue st[u].msg,110,"...")));
      guest_mc.guestMessage_txt.setTextFormat(frm);
      guest_mc.tabChildren = false;
      guest_mc.tabEnabled = false;
      // ADD EVENT LISTISTENER  TO (readMore_btn) FOR EACH (guest_mc)
      addMouseEvent(guest_mc.readMore_btn,readEvent);
      msgContainer.addChild(guest_mc);
      // SHOW/HIDE SCROLL
      if (msgContainer.height < mask_mc.height) {
      scroller.scroll_btn.visible = false;
      else {
      this.mouseChildren = false;
      scroller.scroll_btn.y = 0;
      if(msgContainer.y != 10){
      Tweener.addTween(msgContainer,{y:10,time:1.5,onComplete:initScrollPos});
      else{
      initScrollPos();
      scroller.scroll_btn.visible = true;
      // ADD EVENT  TO SCROLL
      addMouseEvent(scroller.scroll_btn,scroll_Event);
      scroller.scroll_btn.addEventListener(MouseEvent.MOUSE_UP,scroll_Event);
      private function initScrollPos():void{
      this.mouseChildren = true;
      dy = 0;
      initPosition = scroller.scroll_btn.y = scroller.bar_mc.y;
      initContentPos = msgContainer.y;
      moveVal = (msgContainer.height-mask_mc.height)/(scroller.bar_mc.height-scroller.scroll_btn.height);
      rectScroll = new Rectangle(scroller.bar_mc.x + 4,scroller.bar_mc.y,0,scroller.bar_mc.height - scroller.scroll_btn.height);
      private function readEvent(me:MouseEvent):void {
      var _this = me.currentTarget;
      switch (me.type) {
      case "mouseOver" :
      _this.alpha = 0.8;
      break;
      case "mouseOut" :
      _this.alpha = 1;
      break;
      case "mouseDown" :
      // SHOW POPUP WITH MORE INFORMATIONS ABOUT THE CURRENT MESSAGE
      popup_mc.pop_nom.htmlText = setHtmlFormat(15,myXML.name_color,_this.parent._Name) + setHtmlFormat(13,myXML.datePosted_color," - Posted "+_this.parent._Date);
      popup_mc.pop_message.htmlText = setHtmlFormat(13,myXML.message_color,StringUtils.capitalize(_this.parent._Msg));
      popup_mc.pop_message.autoSize = TextFieldAutoSize.LEFT;
      popup_mc.pop_message.setTextFormat(frm);
      popup_mc.back_mc.height = popup_mc.pop_message.height + 50;
      popup_mc.x = (stageWidth - popup_mc.width)/2;
      popup_mc.y = (stageHeight - popup_mc.height)/2;
      addChild(greySprite);
      addChild(popup_mc);
      popup_mc.alpha = 0;
      greySprite.alpha = 0;
      Tweener.addTween(popup_mc,{alpha:1,time:0.6});
      Tweener.addTween(greySprite,{alpha:1,time:0.6});
      break;
      private function setHtmlFormat(_size:Number,_color,_txt:String):String{
      var htmlFrm:String  = "<font size='"+_size+"'color='"+_color+"'>"+_txt+"</font>";
      return htmlFrm;
      private function closeEvent(me:MouseEvent):void {
      switch (me.type) {
      case "mouseOver" :
      popup_mc.close_btn.alpha = 0.8;
      break;
      case "mouseOut" :
      popup_mc.close_btn.alpha = 1;
      break;
      case "mouseDown" :
      if (stage.contains(popup_mc)) {
      Tweener.addTween(greySprite,{alpha:0,time:0.6,onComplete:function(){removeChild(greySprit e)}});
      Tweener.addTween(popup_mc,{alpha:0,time:0.6,onComplete:function(){removeChild(popup_mc)}} );
      break;
      private function scroll_Event(me:MouseEvent):void {
      switch (me.type) {
      case "mouseOver" :
      scroller.scroll_btn.alpha = 0.7;
      break;
      case "mouseOut" :
      scroller.scroll_btn.alpha = 1;
      break;
      case "mouseUP" :
      scroller.scroll_btn.stopDrag();
      scroller.scroll_btn.removeEventListener(Event.ENTER_FRAME, scrollMove);
      break;
      case "mouseDown" :
      scroller.scroll_btn.startDrag(false, rectScroll);
      scroller.scroll_btn.addEventListener(Event.ENTER_FRAME, scrollMove);
      stage.addEventListener(MouseEvent.MOUSE_UP, releaseOut);
      break;
      private function scrollMove(event:Event):void {
      dy = Math.abs(initPosition - scroller.scroll_btn.y);
      msgContainer.y = Math.round(dy * -1 * moveVal + initContentPos);
      private function releaseOut(me:MouseEvent):void {
      scroller.scroll_btn.stopDrag();
      scroller.scroll_btn.removeEventListener(Event.ENTER_FRAME, scrollMove);
      stage.removeEventListener(MouseEvent.MOUSE_UP, releaseOut);
      private function sendEvent(e:MouseEvent):void {
      switch (e.type) {
      case "mouseOver" :
      form_mc.send_btn.alpha = 0.7;
      break;
      case "mouseOut" :
      form_mc.send_btn.alpha = 1;
      break;
      case "mouseDown" :
      // CHECK FIELDS AND EMAIL THEN SEND DATA TO PHP
      if (form_mc.name_txt.text == "") {
      stage.focus = form_mc.name_txt;
      show_alert("You must enter the : « Name »");
      else if (form_mc.email_txt.text == "") {
      stage.focus = form_mc.email_txt;
      show_alert("You must enter the : « E-mail »");
      else if (form_mc.validating.currentFrame == 1) {
      stage.focus = form_mc.email_txt;
      form_mc.validating.alpha = 1;
      form_mc.validating.gotoAndStop(1);
      show_alert("« E-mail » address is incorrect");
      else if (form_mc.message_txt.text == "") {
      stage.focus = form_mc.message_txt;
      show_alert("You must enter the : « Message »");
      else {
      sendData();
      break;
      private function checkMail(e:Event):void {
      form_mc.validating.alpha = 1;
      var mail_validation:RegExp = /^[a-z][\w.-]+@\w[\w.-]+\.[\w.-]*[a-z][a-z]$/i;
      mail_validation.test(form_mc.email_txt.text);
      if (mail_validation.test(form_mc.email_txt.text) == true) {
      form_mc.validating.gotoAndStop(2);
      form_mc.alert_txt.text = "";
      else {
      form_mc.validating.gotoAndStop(1);
      private function clearAlert(te:TextEvent):void {
      if (form_mc.alert_txt.text != "") {
      form_mc.alert_txt.text = "";
      private function show_alert(txt:String):void {
      form_mc.alert_txt.htmlText = "<font color='" + myXML.alert_color + "'>" + txt + "</font>";
      private function sendData():void {
      // SEND NAME-EMAIL-MESSAGE TO PHP
      this.mouseChildren = false;
      form_mc.wait_mc.visible = true;
      var phpLoad:URLLoader = new URLLoader  ;
      var phpReq:URLRequest = new URLRequest(myXML.phpURL);
      phpReq.method = URLRequestMethod.POST;
      phpReq.data = new URLVariables  ;
      phpReq.data["name"] = StringUtils.stripTags(form_mc.name_txt.text);
      phpReq.data["email"] = form_mc.email_txt.text;
      phpReq.data["message"] = StringUtils.stripTags(form_mc.message_txt.text);
      phpLoad.addEventListener(Event.COMPLETE,insertPHP);
      phpLoad.load(phpReq);
      private function insertPHP(e:Event):void {
      this.mouseChildren = true;
      var phpXML:XML = new XML(e.target.data);
      form_mc.send_btn.mouseEnabled = true;
      form_mc.wait_mc.visible = false;
      if (phpXML.inserted == 1) {
      startPageFlip();
      form_mc.alert_txt.htmlText = myXML.insert_ok;
      form_mc.validating.alpha = 0;
      form_mc.validating.gotoAndStop(1);
      while (msgContainer.numChildren) {
      msgContainer.removeChildAt(msgContainer.numChildren-1);
      // SHOW THE CURRENT POSTED MESSAGE AND CLEAR FIELDS
      showMessages(phpXML);
      clearFields();
      else {
      form_mc.alert_txt.htmlText = myXML.insert_error;
      private function clearFields():void {
      form_mc.name_txt.text = "";
      form_mc.email_txt.text = "";
      form_mc.message_txt.text = "";
      form_mc.validating.gotoAndStop(1);
      form_mc.validating.alpha = 0;
      private function addMouseEvent(_targ,_func):void {
      _targ.buttonMode = true;
      _targ.mouseChildren = false;
      _targ.addEventListener(MouseEvent.MOUSE_OVER,_func);
      _targ.addEventListener(MouseEvent.MOUSE_OUT,_func);
      _targ.addEventListener(MouseEvent.MOUSE_DOWN,_func);

  • Creating AS3 code for C++ classes converted with Alchemy (a là Box2D)

    So I've a collection of C++ classes which I now have converting fine with Alchemy to a swc file and can call the exposed functions fine from my AS3 code.
    What I'd really like to do is recreate stuff like Box2D's b2Vec.as class,
    public class b2Vec2 extends b2Base {
        public function b2Vec2(p:int) {
            _ptr = p;
        public function get v2():V2 {
            return new V2(x, y);
        public function set v2(v:V2):void {
            x = v.x;
            y = v.y;
        public function get x():Number { return mem._mrf(_ptr + 0); }
        public function set x(v:Number):void { mem._mwf(_ptr + 0, v); }
        public function get y():Number { return mem._mrf(_ptr + 4); }
        public function set y(v:Number):void { mem._mwf(_ptr + 4, v); }
    This is a simple example, but shows what I'd like to do.  On the C side of things, b2Vec2 is a struct,
    /// A 2D column vector.
    struct b2Vec2
        /// Default constructor does nothing (for performance).
        b2Vec2() {}
        float32 x, y;
    So, for this struct, it's easy to calculate that the first variable of a b2Vec2 object is a float, which will be the value in x and can be read via Alchemy's MemUser classes _mrf (read a fload from a point in memory) with _mrf(pointerAddress) and you can read in the second float with _mrf(pointerAddress + 4).
    My question is, if you're not a C++ expert (me), is there any way to get the definition of a class, as in the addresses of all the variables within and what they are?  So, for the b2Vec2 one, I'd imaging it'd be something like, float32 x 0 float34 y 4 ...
    The reason I'm asking is because one of the classes in particular has loads of variables and to try and get each and every one's information so I can access it directly from the AS3 code would be lots of work and I'm going to assume I'll introduce plenty of human error to it.

    Hi,
    I am facing the similar issue. Can you please tell me how you solved this problem in more details?
    which sample code and how u can find that in SE24 and where to copy that code.
    Thanks in advance..
    vamsi.

  • AS3 code for Mouse Event

    Hi,
    I had uploaded jpeg file onto the stage using
    File->Import.
    Now, how to access the mouse-events using AS3.0?
    i.e., when we click with mouse on the stage
    it should display the x and y co-ordinates of the point
    being clicked.
    These x and y coordinates must be displayed in text-boxes
    provided down on the same stage.
    Please reply me

    You can do show/hide movieclip on mouseover. get your box
    position and assign to the popup (tooltip movieclip).
    see this...
    not tested. but it should work.
    import flash.events.MouseEvent;
    function showClip(evt:MouseEvent) {
    tooltips.x = evt.target.x + evt.target.width;;
    tooltips.y = evt.target.y - evt.target.height;
    tooltips.visible = true
    function hideClip(evt:MouseEvent) {
    tooltips.visible = false;
    box.addEventListener(MouseEvent.MOUSE_OVER, showClip);
    box.addEventListener(MouseEvent.MOUSE_OUT, hideClip);
    I assume you'll create two movieclips named: box and tooltips

  • Code for Percentage Display of Loading Own Content

    I need an AS3 code for an external AS file that would provide
    the percentage of loading the content of its own swf ( library
    assets, etc ) and NOT external files. And then, after the loading
    is complete, it should add an instance of the main MovieClip ( from
    the library) into the stage.
    ( So far I only found code for preloading an external swf)
    Any idea ?

    Hi Andrei1
    I already have a code that goes embedded in first frame of a
    fla file and it works. The fla has two scenes, one called
    “preloader” and the other just “scene”.
    In the “preloader” scene I have this code in the
    first frame:
    import flash.events.ProgressEvent;
    function LoadingProgress(e: ProgressEvent):void
    var percent:Number = Math.floor(
    (e.bytesLoaded*100)/e.bytesTotal );
    t.text = ""+percent;
    if(percent == 100)
    play();
    loaderInfo.addEventListener(ProgressEvent.PROGRESS ,
    LoadingProgres);
    stop();
    It also has an instance of an animation movieclip in the
    stage that shows the loading progress.
    And in the “scene” scene it has a simple
    instruction as code in the first frame:
    stop();
    And it also has an instance of the main movieclip on the
    stage.
    It works fine, but my version of a separated AS file ( using
    package/class ) is not working.

  • Back from AS3 code into manual adjustment of properties

    Halo.
    Assuming that I change some properties of an DisplayObject on Stage via AS3 code (for example with the use of Tweener).
    In that situation the DisplayObject won't respond any more to manual changes made via Properties Panel and keyframes on Timeline.
    So, is there any way to make the Display Object again vulnerable for keyframes?
    PS:  MyDisplayObject = null;  unfortunately is not a solution in this case.
    Regards

    Not that I know of. Actionscript trumps the timeline. Once you have changed a property, either by changing that property at a keyframe or by Actionscript, that property is changed and will not revert to some earlier state.

  • Is it possible to write a as3 code that will search for particular file in the loacal disk

    Is it possible to write a as3 code that will search for particular file in the loacal disk

    Not for a web-based design

  • Code for a Flash carousal

    Hi,
    Looking for help to fix code for a Flash carousal.
    I lost all my original files in a major hard drive crash. (no
    backup, I learned). I’m now trying to redo the carousel.
    My original site contained a tooltip and a icon.xml that
    direct the icon click to a web page.
    I have enclosed the Flash code the new carousel I created,
    along with the icon.xml file. I have one web page that works using
    the same XML file
    http://www.susystastebuds.com/CakeZone.html
    At this time I’m unable to get new carousel to work on
    any other page. I guess the Flash code has changed since the
    original one I did. I hope someone is able to provide help as to
    why the new one won’t work.
    When I click on the icon now, it will close all the other
    icons and move up to the left and just stop. Not providing any link
    to another web page.
    If anbody has the same code in action script in script 3 that
    includes the Tooltip and goto url, that would be great.
    The Flash action script is:
    import mx.utils.Delegate;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var folder:String = "thumbnails/"; // a folder for thumbnail
    files + an XML file
    var numOfItems:Number;
    var radiusX:Number = 300;
    var radiusY:Number = 40;
    var centerX:Number = Stage.width / 2;
    var centerY:Number = Stage.height / 2;
    var speed:Number = 0.02;
    var perspective:Number = 3;
    var home:MovieClip = this;
    theText._alpha = 0;
    var tooltip:MovieClip =
    this.attachMovie("tooltip","tooltip",10000);
    tooltip._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
    var nodes = this.firstChild.childNodes;
    numOfItems = nodes.length;
    for(var i=0;i<numOfItems;i++)
    var t = home.attachMovie("item","item"+i,i+1);
    t.angle = i * ((Math.PI*2)/numOfItems);
    t.onEnterFrame = mover;
    t.toolText = nodes.attributes.tooltip;
    t.content = nodes.attributes.content;
    t.icon.inner.loadMovie(nodes.attributes.image);
    t.r.inner.loadMovie(nodes.attributes.image);
    t.icon.onRollOver = over;
    t.icon.onRollOut = out;
    t.icon.onRelease = released;
    function over()
    //BONUS Section
    var sou:Sound = new Sound();
    sou.attachSound("sound2");
    sou.start();
    home.tooltip.tipText.text = this._parent.toolText;
    home.tooltip._x = this._parent._x;
    home.tooltip._y = this._parent._y - this._parent._height/2;
    home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
    home.tooltip._alpha = 100;
    function out()
    delete home.tooltip.onEnterFrame;
    home.tooltip._alpha = 0;
    function released()
    //BONUS Section
    var sou:Sound = new Sound();
    sou.attachSound("sound3");
    sou.start();
    home.tooltip._alpha = 0;
    for(var i=0;i<numOfItems;i++)
    var t:MovieClip = home["item"+i];
    t.xPos = t._x;
    t.yPos = t._y;
    t.theScale = t._xscale;
    delete t.icon.onRollOver;
    delete t.icon.onRollOut;
    delete t.icon.onRelease;
    delete t.onEnterFrame;
    if(t != this._parent)
    var tw:Tween = new
    Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
    var tw2:Tween = new
    Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
    var tw3:Tween = new
    Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
    else
    var tw:Tween = new
    Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
    var tw2:Tween = new
    Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
    var tw3:Tween = new
    Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
    var tw4:Tween = new
    Tween(t,"_y",Strong.easeOut,t._y,320,1,true);
    var tw5:Tween = new
    Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
    theText.text = t.content;
    var s:Object = this;
    tw.onMotionStopped = function()
    s.onRelease = unReleased;
    function unReleased()
    //BONUS Section
    var sou:Sound = new Sound();
    sou.attachSound("sdown");
    sou.start();
    delete this.onRelease;
    var tw:Tween = new
    Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
    for(var i=0;i<numOfItems;i++)
    var t:MovieClip = home["item"+i];
    if(t != this._parent)
    var tw:Tween = new
    Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
    var tw2:Tween = new
    Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
    var tw3:Tween = new
    Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
    else
    var tw:Tween = new
    Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
    var tw2:Tween = new
    Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
    var tw3:Tween = new
    Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
    var tw4:Tween = new
    Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
    tw.onMotionStopped = function()
    for(var i=0;i<numOfItems;i++)
    var t:MovieClip = home["item"+i];
    t.icon.onRollOver = Delegate.create(t.icon,over);
    t.icon.onRollOut = Delegate.create(t.icon,out);
    t.icon.onRelease = Delegate.create(t.icon,released);
    t.onEnterFrame = mover;
    function moveTip()
    home.tooltip._x = this._parent._x;
    home.tooltip._y = this._parent._y - this._parent._height/2;
    xml.load("icons.xml");
    function mover()
    this._x = Math.cos(this.angle) * radiusX + centerX;
    this._y = Math.sin(this.angle) * radiusY + centerY;
    var s = (this._y - perspective)
    /(centerY+radiusY-perspective);
    this._xscale = this._yscale = s*100;
    this.angle += this._parent.speed;
    this.swapDepths(Math.round(this._xscale) + 100);
    this.onMouseMove = function()
    speed = (this._xmouse-centerX)/10000;
    The XML file is:
    <icons>
    <icon image="icon4.png" tooltip="Baby1" url="
    http://www.susystastebuds.com/BirthdaycakeZone.html"
    />
    <icon image="icon5.png" tooltip="Wedding Anniversary Zone"
    url="
    http://www.susystastebuds.com/AnniversaryCakeZone.html"
    />
    <icon image="icon6.png" tooltip="The Other Zone" url="
    http://www.susystastebuds.com/OtherCakeZone.html"
    />
    <icon image="icon7.png" tooltip="Specialty Zone" url="
    http://www.susystastebuds.com/Specialitys_Zone.html"
    />
    <icon image="icon8.png" tooltip="The Cupcake Zone" url="
    http://www.susystastebuds.com/CupCakeZone.html"
    />
    <icon image="icon9.png" tooltip="Home Page" url="
    http://www.susystastebuds.com/home"
    />
    <icon image="icon2.png" tooltip="Birthday Zone" url="
    http://www.susystastebuds.com/BirthdaycakeZone.html"
    />
    <icon image="icon3.png" tooltip="Wedding Zone" url="
    http://www.susystastebuds.com/Weddingcakezone.html"
    />
    <icon image="icon1.png" tooltip="Cakes Of The Week" url="
    http://www.susystastebuds.com/CakeZone.html"
    />
    <icon image="icon10.png" tooltip="Contact Us" url="
    http://www.susystastebuds.com/CakeZone.html"
    />
    </icons>

    I need the code for a simple PopUp (Frame) with a gif
    as background... Should be called from an applet...
    The following code das some errors !!
    Thanks Felix
    public class SHHcycle extends Frame
    getImage(getDocumentBase(),"Image/SHHlinear.jpg");
    public void paint(Graphics screen);
    {Hi,
    you are using applet methods in a frame. You should either make it an applet or find alternatives.
    http://galileo.spaceports.com/~ibidris/

  • Can someone pls help me to change AS3 code to AS2 code

    Hello! Dear All,
    I dont understand why with AS3 code my swf file is not working smooth at all. I would like to try it with AS2. In publish setting when I am selecting Flash Player 8, AS2 my swf is running good but showing lots of code errors.
    I dont have much knowledge about AS2 so if someone can help me with this...it would be great.
    Thanks,
    Cheers!
    Code1:
    import flash.external.ExternalInterface;
    ExternalInterface.addCallback("GetVars",GetVars);
    ExternalInterface.addCallback("SetVariable1",SetVariable1);
    function GetVars():Array {
    return [
      {VariableName:"SetVariable1",DefaultValue:"Variable1"}
    function SetVariable1(variable:String):void {
    for (var i:int = 0; i < numChildren; i++) {
      var mc:MovieClip=getChildAt(i) as MovieClip;
      if (mc!=null&&mc.name=='Audi_Cup') {
       mc.variable1=variable;
       mc.SetVariable1(variable);
    Code 2
    this.mask_mc.cacheAsBitmap=true;
    this.mask_mc.cacheAsBitmap=true;
    Text1.mask=(mask_mc);
    function SetVariable1(variable:String):void {
    if (variable!=null) {
      for (var i:int = 0; i < numChildren; i++) {
       var mc:MovieClip=getChildAt(i) as MovieClip;
       if (mc!=null&&mc.name=='Text1') {
        var object:TextField=mc.getChildByName('InputTextField1') as TextField;
        if (object!=null) {
         object.text=variable;
    SetVariable1(this.variable1);

    it's possible, but unlikely, you'll fix anything by converting to as2.  so, what problems are you having with as3?

  • Assembler in C-code for Alchemy

    Hello all!
    I aspire to reach high performance my left unfinished 3D-renderer for Flash-player. Soon enough I have understood that my ActionScript-code is doomed. Then I have started to learn Alchemy. And thanks to the help Bernd Paradies could transfer any data in the C-code and take away the ready image in the form of ByteArray. And it was essential faster. The same calculations occupying 10-15 seconds, now were measured by milliseconds.
    Wishing to move ahead further, I want to add still productivity in my code.
    I saw some topics about assembler and Alchemy.
    Also I understand what to use "x86-asm-code" in Alchemy it is impossible.
    But I want to ask. I can use "FlashPlayer-llvm-asm-code" in my C-code and in what type?
    Especially I am interested in operations of data transfer and floating point operations between registers (without using variables in memory) interest.

    Hello svolatch123,
    in this forum you'll find some posts about optimizations involving inline assembly code, i.e.:
         optimizing abc-code
         http://forums.adobe.com/thread/686022
         inline functions in C, gcc optimization and floating point arithmetic issues
         http://forums.adobe.com/thread/660099
    But in general I would avoid optimizations at the inline assembler level. Instead I would use profile your app and use the results to zoom in on specific areas that your optimizations will benefit from. You may have already done that and identified floating point calculations as one of those areas. If floating point calculations are your problem then you might be able to get better performance by using integer math internally (if that's possible). This technique is used by programs like Donald Knuth's TeX. The idea is that you do your math in integer units of floats (i.e. 1.234cm = 1 unit, 2 * 3 = 6 units = 6 * 1.234cm = 7.404cm).
    Another performance hog that will probably show up in your profiling results will probably point you to the fact that crossing the border between AS3 and C world (calling from AS3 code into Alchemy-C code and vice versa) is very expensive. You'll get good performance improvements by reducing calls that cross that boundary.
    If there is a piece of code in particular that you need to optimize I would post it here in this forum.
    I am sure you'll find help here.
    Best wishes,
    - Bernd

  • Help changing code for photos.

    hi, i am a complete novice and have managed to use this code
    to load videos into a div on a page, make them invisable, and play
    each individual video on a player when clicked on via a picture
    link in the same page. It works fine, but now i need to change the
    code to do the same thing for showing pictures
    here's the code for the vids
    obviously i have to change the links to photos, and the image
    source, but i need to change something else in the java script to
    get it to work. and i don't know the function for images etc.
    Please could somebody point me in the right direction.
    Thanks

    Hi Tom J.
    If you are intent on mouseover effects for the button, you
    are probably in for a fun ride coding some special solution.
    Personally, if I want an image for these, I take the
    following approach:
    Insert an image.
    Insert the RelatedTopics control and choose "Hidden, for
    scripts"
    Note the actual name of the control. Often it is simply
    RelatedTopics. But depending on how it was inserted, may be
    object1. Just hover the control in your WYSIWYG editor and the name
    should pop up in a tooltip.
    Select the image and make it a hyperlink. But in the
    hyperlink properties, type
    JavaScript:RelatedTopics.Click();. (and if the name differs
    from RelatedTopics, use what you saw instead.
    This method will make it so your user clicks the image and
    the control activates.
    Cheers... Rick

  • Can AS1 code call AS3 code?

    I was wondering if there was any way for AS1 code to call AS3
    code.
    I need to write a server extension for SmartFox Pro. I just
    found out that the only version of action script that SmartFox
    sever extensions can be written in is AS1. However, I have a bunch
    of code already written in AS3 that I need to use. I have all of
    the source for the AS3 code.
    Is there a way for me to use my existing code, or am I out of
    luck?
    Thanks in advance
    John Lawrie

    you may be able to use swfbridge to do so, basically
    implementing the LocalConnection class
    http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html

  • How set location for tooltip text ??

    hi ,
    i want to set tooltip location myself to a button . for this i override methods are
    1. public String getToolTipText(MouseEvent e)2 public Point getToolTipLocation(MouseEvent e)here is code... where i have to change to set location for tooltip
    * DebugGraphicsTest.java
    * Created on April 28, 2005, 1:14 AM
    package swingtest;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * @author  Paramasivam
    public class DebugGraphicsTest extends javax.swing.JFrame {
        public DebugGraphicsTest() {
            initComponents();
            MyButton  btn = new MyButton("Chem m e");
            btn.setToolTipText("this is actual");
            getContentPane().add(btn);
            jButton1.setToolTipText("button 1");
            jButton2.setToolTipText("button 2");
            jButton3.setToolTipText("button 3");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            getContentPane().setLayout(new java.awt.FlowLayout());
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("jButton1");
            jPanel1.add(jButton1);
            jButton2.setText("jButton2");
            jPanel1.add(jButton2);
            jButton3.setText("jButton3");
            jPanel1.add(jButton3);
            getContentPane().add(jPanel1);
            pack();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new DebugGraphicsTest().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration
    class MyButton  extends JButton{
        public MyButton(String s){
            super(s);
        public Point getToolTipLocation(MouseEvent evnt){
            return new Point(100,300);
        public String getToolTipText(){
            return "hihi";
        public String getToolTipText(MouseEvent me){
            return "event hihi";
    }

    Adding the line ToolTipManager.sharedInstance().registerComponent(this); to MyButton's constructor seems to solve the problem.

  • Not Getting Key Code for ALT key

    Hi,
    I am having some trouble in getting key code for alt key. Can Any one help in it.
    I am sharing for source code the way I am trying to do it.
    import flash.events.KeyboardEvent;
    stage.addEventListener(KeyboardEvent.KEY_DOWN, function(e:KeyboardEvent){trace("Key== "+e.keyCode); txt.text=""+e.keyCode;});

    Hi Amanpreet,
    The code i posted was a working example to detect Alt + click. You can try pasting it in the Actions panel of a blank AS3 file, Test Movie, press Alt and Click on the blank area of Stage and see that the trace statement appears in Output panel.
    Flash does not return the keycode of Alt key directly but lets you detect if Alt was pressed or not using 'event.altKey'. This boolean property is available for both Keyboard and Mouse events.
    You can try another sample: (This will only work when you Test Movie on Browser)
    //Place a dynamic textbox named 'txtStatus' on stage to display the text.
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
    function keyHandler(e:KeyboardEvent) {
           txtStatus.text = e.keyCode.toString(); 
           if(e.altKey)
                txtStatus.text = 'alt pressed';
    When you Test Movie in browser, you'll need to click on the Stage area once to set it in focus. Also make sure to embed your fonts or set 'use device fonts' Anti-alias setting to display the text correctly.
    -Nipun

  • Code for working clock

    hi folks,
    i'm trying unsuccessfully to make or get the html code for a clock exactly like this one.
    http://www.tokyodesignlab.com
    i'm not experienced at using adobe flash so making my own is not really on unless i get a video tute.
    i would prefer the html code to put into a snippet in web where i can alter the font and size myself.
    i have tried the numerous clock codes around the internet but the font and sizing are very limited.
    help would be great, thanks.

    It didn't sound at all like you were looking for a Flash solution... you kept saying you want an HTML one.  If you want a Flash tutorial, trying seraching Google using "AS3 digital clock tutorial".  It is not at all difficult to create one, and there should be plenty of tutorials available.

Maybe you are looking for

  • IE9 RC and Latest Flash Player don't work

    IE9 Release Candidate was pushed to tens of thousands of users yesterday and now the latest version of flash player does not work in it. I have one PC on Windows 7 64 bit and another on Windows 7 32 bit... same problem. Sites that use flash to displa

  • PO and GR report

    Hi Gurus, For SOX compliance we are required to check wether a person who creates a PO is the same person who doing the GR or not? for this reason i'm working on a query involving EKKO and MSEG tables. EKKO has the field - name of the person who crea

  • HP 6210 All in one-- Error: 0xb9000002 165:hw_interrupt

    What is this error ?   I tried shutting off the printer -- I cannot clear the message -- all the light are blinking -- Can you help?

  • How to get count of records for each type from internal table

    Hi Guys, I want to implement a logic to find out the count of records in a internal table. Assume my internal table have one field having the entries as shown below. Internal table Entries 10 10 10 11 11 12 12 12 12 13 14 14 15 15 15 15 15 16 16 17 1

  • Cost allocation based on time sheet

    Hi, I have a scenario to capture employees working time based on different projects/  sales order/  Internal services etc., and their cost has to be assigned to respective costcenters based on their actual (no.of hours) effort. For Eg: If an employee