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
-
Several of us have a iPhone 6plus and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?
Not having the problem, don't personally know anyone who is.
-
My iPhone 4 has been having trouble charging.
My iPhone 4 had been having trouble charging for a while so i switched cords thinking that was the problem. That worked for a while then i kept having to switch cords every few days or it wouldnt work. As of last night my phone wont charge with any cord in any computer or in the wall or my car. I got frustrated so i turned it off hoping to preserve what little battery life i had left. When i turned it back on i noticed it had charged! The charge doesnt last as long as it normally did but it still works. When its plugged into the computer and turned on it doesnt recognise that its plugged into anything and doesnt start syncing or charging but if i go into iTunes it recognises the device is connected and i can manually sync my phone as long as it is on. Do i need to replace the charging port? Does the battery also need replaced? Has anyone else had this happen?
Sounds like the iPhone has a hardware problem with the battery, with the charging port, or both.
-
I have downloaded and installed the new ios7 software on my iphone 4s but im having trouble getting through the activation process i keep getting the message "iphone could not be activated because the activation server cannot be reached"? any suggestions?
The activation servers are probably overloaded with everyone trying to update to iOS 7 today. You might need to wait and try again later.
-
Since downloading the new operating system on my iPhone 4S, I'm having trouble with my phone messaging. I enter a number or input a number from my contacts and send my message. I then receive a error message stating the message can't be sent and it shows a set of "1s" were added in front of the number I entered. Ex: 1 (1) xxx-xxx-xxxx. Does anyone know why this is happening and how I can fix it?
I realize this. When calling prepaid cus service it only gives you the option to input your #. If you dont the system hangs up on you. When I input my number the system doesnt recognize it and hangs up on me.
-
I am trying to authorize my Mac for my iphone but i am having trouble doing that
I am trying to authorize my computer so i can back up my iphone and i am having touble
Hello lehernandez,
If iTunes is repeatedly prompting you for authorization, the following article provides steps that can help get iTunes properly authorized.
iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
http://support.apple.com/kb/TS1389
Cheers,
Allen -
Flash having trouble reading audio mp3 file
I am trying to add background music to a website using
Dreamweaver 8 and followed the embed instructions and it doesn't
seem to be playing. I tried the file in both wma and mp3 formats.
My next step was to import it into flash and create a .swf of
the music file. Flash will not import it due to difficulty reading
the file. This file will play independently on different computers
with Windows Media Player. Does anyone have any suggestions as what
I can do to make this work? I ripped the music from the cd the
artist provided for me. Could this possibly be the issue?
To view the website in progress you can visit
www.fourwindscouncilga.com the sound file is on the splash "Enter
Here" page.Have you received any answers or solutions to this? I also
came across the same situation and couldn't find support. -
Hello , it's me again with the second hand iPhone. I am trying to sync it to my computer and after buying some apps I thought it would be easy. Anyway, when I go through the process it always comes up with the previous owners ID and will not let me sync to my computer. Can you give me guidence so that I can move on to the next stage of Hi Tech products.
It will restore it as it was when it was new.
You can then set it up as your own.
iPhone User Guide (For iOS 5.0 Software) -
I have just recieved a new iphone however i cannot log in to my icloud. i last logged in on monday at the apple store however since then no luck. i did notice the techician did not log out of my account.
Go back to the Store.
tamz87 wrote:
.... i last logged in on monday at the apple store .... i did notice the techician did not log out of my account.
What does all this mean? -
HT6208 my iphone is disabled and having trouble turning it back on.
I've held the "off/on" button on top and the bottom button at the same time till the Apple logo appears.
And that"s it. Nothing else happens.
Screen still says "disabled".Hello Rayydogg22,
It sounds like your iPhone may be disabled due to a forgotten passcode. I recommend the following article if you are not able to gain access to the iPhone because of a forgotten passcode:
iOS: Forgotten passcode or device disabled after entering wrong passcode
http://support.apple.com/kb/ht1212
Thank you for using Apple Support Communities.
Best,
Sheila M. -
My husband and I both have an iphone5. I had mine first and setup my itunes account. When we purchased his phone we sent up another itunes account but on the same computer. Now we are running into problems, especially when he wants to set up playlists from his music to his phone and in general with synching. should we start over with just one itunes account and both use that with the one computer?
By the sounds of it you have linked Email Accounts, if so this means that you will both recieve the majority of the same Emails, and if you do and you read them on your account (which is linked with your husbands) then they will appear to read on the both of them because they are linked. With the majority of Email providers these days they're Emails are (simplified) in the cloud you could say, meaning that if you read or delete shared Emails then it will do the same on both accounts rather than just the yours.
I hope all that made sense, sorry that I couldn't be of anymore assistance.. If you havent already try googling your problem - you may find some answers on there -
I need help as soon as possible
The Apple ID and Password that was Originally used to Activate the iDevice is required.
Activation Lock in iOS 7 > http://support.apple.com/kb/HT5818
There is No workaround. -
Need help being able to play my music again!!
SBerman- I am the only owner/user of the phone but thanks for trying on that angle. It doesn't apply but I appreciate your idea.
KiltedTim- Yes, I have encountered an activation lock. The Apple ID should be the one that I use when I go into itunes but that one is not working. I even tried the Apple email/id I got when I first bought the phone years ago and that didn't work either. It is asking me for an id that ends in @me.com and I have NO IDEA what this is or how to get it to "shift focus" onto one of the id's I do know.
Does that make things clearer? -
I changed my comcast password (on my phone) and now am having trouble sending out emails from my Mac.
Did you change the password on your Mac as well? Go to Mail / Preferences / Accounts and change it there too.
-
I would like to create a new icloud email but I'm having trouble doing that. Can you help me?
I have account but need a second one and for the life of me cannot remember how to do it....
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