How to move code from one class to another?
I have a .fla file.
Here, I have a few keyframes with labels.
On the .fla file in the property in the field of the class I have adde class MyMatching.
I also have the main code:
package { import flash.display.MovieClip; import flash.events.MouseEvent; import flash.text.TextField; public class MyMatching extends MovieClip { var play_btn:MyButton = new MyButton(); var kyky:MyTimer; public function MyMatching():void { welcomeScreen(); } public function welcomeScreen():void { stop(); trace("working"); play_btn.x = 210; play_btn.y = 300; addChild(play_btn); play_btn.addEventListener(MouseEvent.CLICK, goToLevel_1); } public function goToLevel_1(event:MouseEvent) { trace("level 1"); play_btn.visible = false; gotoAndStop('Level1Screen'); if (kyky==undefined) { kyky = new MyTimer(); } } } }
And I have another class:
package { import flash.display.MovieClip; import flash.display.Stage; import flash.utils.getTimer; import flash.text.TextField; public class MyTimer extends Stage { import flash.utils.getTimer; var gameStartTime:uint; var gameTime:uint; var gameTimeField:TextField; function mainFunction():void { gameTimeField = new TextField(); addChild(gameTimeField); gameStartTime=getTimer(); gameTime=0; addEventListener(Event.ENTER_FRAME,showTime); } function showTime(event:Event) { gameTime=getTimer()-gameStartTime; gameTimeField.text="You plaing: "+clockTime(gameTime); } function clockTime(ms:int) { var seconds:int=Math.floor(ms/1000); var minutes:int=Math.floor(seconds/60); seconds-=minutes*60; var timeString:String=minutes+":"+String(seconds+100).substr(1,2); return timeString; } } }
Ho can I play MyTimer class code in the function goToLevel_1 (this furnished function in my main class MyMatching)?
Thank you.
First your class MyTimer is sloppy and poorly written.
Why does go on stage? The more compact class to extend the circumstances is Sprite.
In addition, it is very important to get the habit of data type declarations. Not only it is advisable, in your case the good compiler will throw error because even if you return the string, function returns nothing.
In addition, it is important to declare namespaces as public private and protected within the classes. No function clickTime (): String but private function clockTime (): String or publicfunction clickTime (): String.
How to show your time elsewhere - you just create instnace of it and add it to the list of disaply:
var myTimer:MyTimer = new MyTimer();
addChild (myTimer);
That said, your class should look like this:
package { import flash.display.Sprite; import flash.events.Event; import flash.display.MovieClip; import flash.utils.getTimer; import flash.text.TextField; public class MyTimer extends Sprite { private var gameStartTime:uint; private var gameTime:uint; private var gameTimeField:TextField; public function MyTimer() { gameTimeField = new TextField(); addChild(gameTimeField); gameStartTime = getTimer(); gameTime = 0; addEventListener(Event.ENTER_FRAME,showTime); } private function showTime(event:Event):void { gameTime = getTimer() - gameStartTime; gameTimeField.text = "You playing: " + clockTime(gameTime); } private function clockTime(ms:int):String { var seconds:int = Math.floor(ms / 1000); var minutes:int = Math.floor(seconds / 60); var timeString:String = minutes + ":" + String(seconds + 100).substr(1, 2); return timeString; } } }
Tags: Adobe Animate
Similar Questions
-
How to migrate code from one environment to another in the MFT 12 c
Hi all
How to migrate code from one environment to another in the MFT 12 c.
Thank you and best regards,
Tilquin.
MFT has t2p plugin that can be used to migrate the metadata for production test.
There is an export option in the transfer page in the MFT UI that can be used to export metadata data transfer.
This exported zip can be imported in any other environment after making the necessary changes.
-
How to move photos from one Collection to another Collection
Some, while the rear I hung some pictures from one Collection to another Collection.
Later, I noticed that I had lost the ability to edit images moved.
Please explain how can I move photos between Collections without causing problems?
Cliff
However, I can't figure out how to move photos from a private Collection to another more appropriate called Collection. I had thought that drag would do the trick. But I was wrong.
Well, I think it's the right way to do it. Why do you think it's wrong? What is going on? Describe in detail or show a screenshot. State of the edited, complete error messages, Word for Word.
-
How to move email from one dish to another?
My old computer broke down, I have the hard drive and the data are ok. How can I move old email on my new computer?
You should be able to move (copy) as if nothing has happened by following the instructions in the article to move data from Thunderbird to a new computer .
-
How to move pictures from one folder to another folder?
Heyya! I am trying to move images off 1 folder in another folder how do? Please answer as soon as possible!
Highlight the files > right click Select Cup > right in the new folder click select Paste
I hope this helps.
-
How to move pictures from one album to another?
I tried to create an album called 'selfies' but when I clicked on some of my photos to this album, about 175 photos moved by mistake in this album. When I tried some out, my choice seems to be only to remove them! I don't want to delete one of them, just move them out of the album 'selfie '!
If you are viewing a photo album you should be able to secondary click (click right click or control) and one of the options should be 'delete album '.
-
How can I move notes from one folder to another?
I thought that some of my notes were missing, but it seems that some are stored in icloud and the other in different files associated with my personal email address. How can I make sure that they are all on the icloud (in case I lose my phone, when I update my phone, etc.)? How can I move them from one folder to another? I not create separate records in the first place. I guess it happened when I updated to the current IOS. Thanks for your help!
Slide left on each note you want to move to your iCloud folder. Move and delete option is available. The rest is simple.
-
How to move items from one profile to a local storage
original title: move items from one profile to a local storage
How to move items from one profile to a local storage to free up space under this profile?
Hi MartySlaught,
· You want to move the files in your user account on a different medium (external hard drive)?
If so, you can do this only for your personal files. You can refer to the following.
a. make sure that your external USB hard drive or a USB flash drive is connected to your computer.
b. open the directory on your computer where are the files you want to transfer. Press 'Ctrl' key and click each file you want to transfer.
c. click on the option "Move selected files" on the left side of the window. Then select the external USB hard disk or USB flash drive. The files will be moved from the computer to the external hard drive.
See also:
-
How can I move photos from one folder to another?
* Original title: photos
How can I move photos from one folder to another?
A way - http://windows.microsoft.com/en-US/windows7/Move-and-copy-files-using-drag-and-drop
More here - §ion_5 http://windows.microsoft.com/en-us/windows/working-with-files-folders#1TC=windows-7
-
How can I easily move photos from one folder to another?
How can I easily move photos from one folder to another?
On Mon, 15 Sep 2014 23:49:43 + 0000, Frygardener wrote:
How can I easily move photos from one folder to another?
Images or any other type of files, there are many easy ways to do
This. And here's one: click on the file and press Ctr + C (copy). Then go to
the folder that you want and press Ctrl + V (paste). -
How can I move photos from one date to another in my catalog? Downloaded LR of photos taken over several days to a date. LR6 Win7 PC.
Hi bubba43,
Please select the images in the library grid mode Module and then drag and drop them in another folder you want.
Kind regards
Tanuj
-
Ability to move songs from one playlist to another
I want to spend the songs in a playlist to another. It seems, that you can´t move the songs, but you can add them to other playlists. After that, I have to remove it from the previous list.
It is extra work that can be avoided, if "move" menu will be executed in ITunes. "
I'm not the first person who wants the same thing. See, for example move the songs in a playlist to another, -playlist-to-another-on-iPad/td-p/120348 https://community.spotify.com/t5/Help-iOS-iPhone-iPad/How-to-move-songs-from-one
I am running Windows, ITunes 12.3.2.35 64-bit
Yet another candidate for iTunes comments. That said if you have done the selection and used the right click Add to Playlist option is really so difficult to then click on remove, while the tracks are always selected in the original list?
TT2
-
I can't move files from one folder to another on Windows Vista.
Hello
I can't move files from one folder to another in windows Vista.It is quite frustrating.I am an administrator of the account.I get an error saying that I don't have permission to do the action.It is said: Destination folder access denied. You need permission to perform this action. Then the buttons 'Try Again' and 'Cancel '.Help, please!Here is a link to an image of the error I get when I try to move a file:Thank youJeremyExplorer
Explorer (explorer.exe) is the program that is the start menu and taskbar, windows folder and the office (which is a folder window).
To see if a fix is available
In Control Panel (and select Classic discovered in the left pane) select reports on the problems and Solutions (problem of type in the START search box), go to historical problem, right-click of your error and choose check for the Solution.
You can also right-click and choose Details for more information. Post these details here. The name of the Module fault is important information.
If the problem affects Panel press the Windows key + R and type wercon (or type it at a command prompt).
Close the browser and start a command prompt
- Close Windows Explorer
- Start - All Programs - Accessories - right on command prompt and choose run as administrator.
- Click Start. Ctrl + Shift + Right-click on an empty spot (just above the power of buttons is one place) then Exit Explorer.
- Press Ctrl + Alt + Delete then Task Manager.
- Control all processes to explore are closed. On the process tab select explore and right-click and choose end process, repeat if more of an Explorer in the list.
Then to restart the Explorer after trying all of the following
- Press Ctrl + Alt + Delete and choose Task Manager
- In the Task Manager, click the file menu and then click new task (run) and enter explorer
If you cannot start the Explorer at all
- Press Ctrl + Alt + Delete and choose Task Manager
- Under the processes tab, click Show processes from all users to elevate to administrator
- In the Task Manager, click the file menu and then click new task (run) and type cmd
- Other things you can try typing
Explorer
Explorer c:\
Explorer/e, c:\
wercon
control
Iexplore
Rstrui
If you cannot start a folder window you can use the Browse button in the new task dialog. Don't forget that you must right click and choose Open rather than double-clicking.
Reregister the shell registry entries
It is important that each order is accepted. If the command fails it means the file is damaged and must be repaired.
Close the Explorer like above and then type at the command prompt (or copy and paste by clicking in the command prompt window and choose Paste).
regsvr32 /i shell32
regsvr32 /i urlmon.dll
regsvr32 RPCRT4.dll
regsvr32 PROPSYS.dll
regsvr32 MSCTF.dll
regsvr32 cscui.dll
regsvr32 rsaenh.dll
regsvr32 timedate.cpl
regsvr32 ATL DLL
regsvr32 OLEACC.dll
regsvr32 actxprxy.dll
regsvr32 USERENV.dll
regsvr32 msshsq.dll
regsvr32 NaturalLanguage6.dll
regsvr32 thumbcache.dll
regsvr32 WINTRUST.dll
regsvr32 MMDevAPI.DLL
regsvr32 audioses.dll
regsvr32 audioeng.dll
regsvr32 ExplorerFrame.dll
regsvr32 msi.dll
regsvr32 FirewallAPI.dll
regsvr32 netshell.dll
regsvr32 pnidui.dll
regsvr32 QUtil.dll
regsvr32 c:\windows\system32\wpdshserviceobj.dll
regsvr32 WINHTTP.dll
regsvr32 C:\windows\system32\qagent.dll
regsvr32 C:\windows\system32\portabledeviceapi.dll
regsvr32 wbemprox.dll
regsvr32 wbemsvc.dll
regsvr32 fastprox.dll
regsvr32 imapi2.dll
regsvr32 wshext.dll
regsvr32 gameux.dll
regsvr32 msxml6.dll
regsvr32 vbscript.dll
regsvr32 jscript.dll
regsvr32 wshext.dll
regsvr32 wshom.ocx
regsvr32 wshcon.dll
regsvr32 scrrun.dllDelete the folder and the settings of the Menu
This will remove the settings are saved for each file that you visit. Also the order of the start menu.
Close the Explorer like above and then type at the command prompt (or copy and paste by clicking in the command prompt window and choose Paste).
Reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell" /f
Reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams" /f
Reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2" /f
Reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder" /f
Delete the thumbnail and icon Caches
Close the Explorer like above and then type at the command prompt (or copy and paste by clicking in the command prompt window and choose Paste).
attrib - r s h '% userprofile%\AppData\Local\*.db '.
del "% userprofile%\AppData\Local\*.db".
Disable thumbnails and previews
Damaged documents and particularly corrupt pictures or videos, can cause Explorer crash all trying to generate a thumbnail or an overview. This miniature and previews active option off.
If you can start the Explorer, previews is Union on the command - folder and Search Options - framework of tasks use classic Windows foldersbar.
Thumbnails are organized on the command bar - folder and Search Options - view tab - and check under Advanced settings - always show icons, never thumbnails and uncheck Show icon file in the pictures.
If you cannot start the Explorer close Explorer as above and then type at the command prompt (or copy and paste by clicking in the command prompt window and choose Paste).
Tracking Add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" v "IconsOnly" /t Reg_DWord /d 00000001 f
Tracking Add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" v "ShowPreviewHandlers" /t Reg_DWord /d 00000000 f
Tracking Add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" v "ShowTypeOverlay" /t Reg_DWord /d 00000000 f
Turn around after testing the Explorer.
Tracking Add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" v "IconsOnly" /t Reg_DWord /d 00000000 f
Tracking Add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" v "ShowPreviewHandlers" /t Reg_DWord /d 00000001 f
Tracking Add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" v "ShowTypeOverlay" /t Reg_DWord /d 00000001 f
A boot is a way to explore
It can be caused by a shell extension.
Explorer (explorer.exe) is the program that is the start menu and taskbar, windows folder and the office (which is a folder window).
The Explorer is built on addin programs called Extensions of Shell. The standard is provided by Microsoft, but programs add their own.
- Download Autoruns http://technet.microsoft.com/en-us/sysinternals/bb963902.aspx
- Close Windows Explorer
- Start Autoruns by right-clicking and choose run as administrator
- Click on the menu Options - Filter Options and check hide Microsoft entries and disable include empty locations
- Go to the Explorer tab and uncheck everything to the left.
- Click Start. Ctrl + Shift + Right-click on an empty spot (just above the power of buttons is one place) then Exit Explorer.
- Press Ctrl + Alt + Delete and choose Task Manager. Control all processes to explore are closed. On the process tab select explore and right-click and choose end process, repeat if more of an Explorer in the list.
- Click the file menu and then click new task (run) and enter explorer
If this can help, reactivate ½ at a time to identify those who. If this does not help, restart AutoRuns and go to the all tab and uncheck everything that it and restart. If this can help, reactivate ½ at a time to identify those who.
Run Microsoft Fixit
Microsoft has a range of automatic programs to solve common problems. To see problems explore
http://support.Microsoft.com/mats/windows_file_and_folder_diag/en-us
For the visit of the list the most comprehensive
http://support.Microsoft.com/FixIt/en-us
When you choose to download, choose the option to run on another computer. You can then save it to your hard drive. Open the folder, open the folder fix this laptop and run Run Fix It. It will contain all 27 FixIt.
Recycle BinIf the problem is the trash bin remove the storage folders. It will be automatically re-created next time you delete a file or open the Recycle Bin. It will remove the trash and the files it contains for all users.Close the Explorer like above and then type at the command prompt (or copy and paste by clicking in the command prompt window and choose Paste).RD C:\$RECYCLE. BIN/s/qthen repeat for each drive to change the drive letter, for exampled:\$recycle Rd. BIN/s/qe:\$recycle Rd. BIN/s/qIf the Office does not startThis will create a new empty by user and common desktop computer. This will allow to test if a file on your desktop to start the Explorer.Close the Explorer like above and then type at the command prompt (or copy and paste by clicking in the command prompt window and choose Paste).MD "% userprofile%\DesktopTest".Add reg "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" / v/t desktop REG_EXPAND_SZ /d "% USERPROFILE%\DesktopTest" /fMD "% public%\desktopTest".Tracking Add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" v "Common Desktop" REG_EXPAND_SZ /d "% Public%\DesktopTest" t fTo restore default after having tested if begins to explore.Set ExpFix1 = % userSet ExpFix2 = % profilereg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" / v/t desktop REG_EXPAND_SZ /d "% ". ' ExpFix1 ExpFix2%% \Desktop "/fSet ExpFix1 = % PubSet ExpFix2 = % licreg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Common Desktop" /t REG_EXPAND_SZ /d "% ". ' ExpFix1 ExpFix2%% \Desktop "/fYou will need to disconnect then. -
How to transfer files from one user to another in Windows Vista?
How to transfer files from one user to another under Vista?
How to transfer files from one user to another under Vista?
A simple way is to move the file to the Public folder.
Public folder is accessible by all users.How...
Right click on the file > click Move To > navigate to the Public folder > click on move.If you do not Move To option in your right click context Menu, here is the tutorial...
http://www.Vistax64.com/tutorials/89196-context-menu-add-copy-folder-move-folder.htmlUse an easier method.
PS you can also use methiod drag-and-drop rather than pass to the method. I prefer the latter.
-
I use Windows XP - perfectly up-to-date. Whenever I have move photos from one folder to another file, the picture is no longer available and cannot be removed with using unlocker. This has happened for several years. I copy pictures and new folders whenever I want to move them, but sometimes I forget and move them and then I lose the picture I'm trying. I also noticed that there is a strange file that opens in the trash that won't let me remove it without using unlocker. These files start with "Dd" followed be a number. When I delete these use unlocker, another will appear the a different number on this subject. It is a very maddening problem. It is not possible for me to do a system restore because it lasts for quite awhile. Please help - I'm tired of losing pictures that I can't replace. Thank you for your help.
Hi JB_11321,
Thanks for the reply.
Have you tried methods 1 and 3 mentioned in my previous post?
We meet after completing the steps so that we can better help you.
Maybe you are looking for
-
I have empty files on CD burning & DVD
On burning data on CD and DVD when they re-inserted in the same PC, the files that have been burned are shown as empty. However, when the same CD/Dvd is placed in other devices, the information in the files are readable. By result, although I can bac
-
Computer laptop Gateway is dead. Need files of it.
I have a gateway MX3702 Windows XP laptop. It worked fine one minute and then more nothing. It turns even if it is plug inn and the battery is fully charged. There are many class I had not been backed up and are extremely important. Is it possible to
-
Problem with graphics drivers nvidia
Hello. I recently had some problems with my graphics card. One day when I booted up my laptop, I had a strange bsod pointing out the error nvddlmkm.sys. I didn't know what she was related to, so I started in safe mode with network and searched the ne
-
My photosmart 209 am printer won't connect to my router. the router is a linksys wrt54gs. It was signed in b4, and then quit internet and came back on it, then the router of the fins coudnt more. He told me to put a PIN in the router but I do not kno
-
BlackBerry smartphones unwanted suggestions app on the curve 9380
Hi bb forum, my problem is with my curve 9380 whenever I have my device off and turn on again once I have many suggestions app undesirable even if no sim card is in the device is the problem with these "spam advertising." I would be grateful if you t