Creating a simple android/iphone game in flash-- having trouble

Hey,
I am a bit rusty on my flash, but not on my C++ or PHP. I am trying to get my movieclip to move on the x axis when a button is clicked and when that movieclip is clicked it dissapears. Pretty simple program, so I don't know what I am doing wrong. I am rewriting a program from c++ into AS3. I do this
var mymc:MovieClip = new MovieClip;
mymc.addEventListener(MouseEvent.CLICK, afunction);
function afunction(event:MouseEvent):void
mymc.x = +2;
mymc.visible = false;
I am pretty sure my problem is that I need to put the mymc.x = +2; code within the movie clip, so it runs when the movieclip runs and when someone clicks on the movieclip it will run the function afunction to make it invisible. Am I correct in my assumption?

in as3 we dont use +2 for moving a movieclip, it would be something like += 2 if you wanted to move it constantly by two, but it would have to be a enter frame handler, If you want to simply movie it to a destination:
var mymc:MovieClip = new MovieClip;
mymc.addEventListener(MouseEvent.CLICK, afunction);
function afunction(event:MouseEvent):void
mymc.x = 100;
mymc.visible = false;
if you want it to look good, i suggest looking into greenstock, the as3 tweening engine. Its really easy to use here's an example:
TweenLite.to(mymc, 3, {x:100});
you instance your movieclip you want to move "my mc", then state the duration of the tween "3" and then the x value you want to tween the object to "[x:100]"

Similar Messages

Maybe you are looking for

  • Upload Document for report in WAD/Bex

    Dear All, Any clue on attaching/uploading the document for a report in Web Application designer/BEx  with BW 3.5 ? Can't ask an end-user to go to RSA1 => Document Please share your expertise / prior experience on same. Thanks in advance. Regard, Pal.

  • X-FI XTREME GAMER CARD IS NOT FOUND BY COMPUTER OR SOFTWARE

    Hello Friends Recently i bought a refufbished x-fi gamer card from ebay, its pci card, i tried to instal but the hardware is not getting recognized either by the computer or by the software, when i tried to install the software it says suitable devic

  • Need an example for work flow based on multistep activity

    hi, i need an example for work flow based on multistep activity for practicing.please do the need. thanks

  • BUG 1.5 : Can't create package body.

    I'm getting this stack dump in the console trying to create a package body. I'm logged in as a dba. executed 'alter session set current schema=x'; created package in the worksheet. opened package from Other users|x|packages. Edited and compiled packa

  • Can't get a strait answer from Verizon on loyalty program

    I've called Verizon several times regarding how best to get monthly charges more in line with the true value of the services.  It seems (like most companies) Verizon wants you to spend more and more each month on phones, plans, etc. but the value jus