Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by chariot · Apr 27, 2015 at 12:40 PM · actionscript

ActionScript to Unity?

Hi, there. Now I have one task - porting flash game (from fb) to Unity (mobile). I have sources in AC3 that used some flash lybraries. Can I used it on Unity 5? If I convert scripts from AC3 to JS - where I can get some analogs for flash namespaces (flash.events.Event, etc)? Or can I use C++ code in Unity project (we have working analogs of flash namespaces in C++)?

Any help will be great. Thnx

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by another_kind · Apr 27, 2015 at 02:02 PM

I'm fairly new to Unity but I used to work with Flash and AS3 also. I'm afraid you're going to have to rewrite everything either in JS or C# using Unity Classes (I'm using C# myself as it seems most people do and it's more strict).

Unity works differently from Flash in many ways and from what I can tell, it's better suited for game development. I suggest you start by watching a few tutorials and then dive into the code reference to see what classes are available and how you can replicate the functions of your AS3 code.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image chariot · Apr 27, 2015 at 02:10 PM 0
Share

rewriting isnt a problem, ofc. but where i can get some methods such as flash.events.Event ant etc.? or its impossible?

avatar image jodev · Apr 27, 2015 at 02:27 PM 1
Share

With the exception of the GUI system introduced in 4.6, Unity doesn't really use events. I haven't really used this new GUI system yet, but as far as I know it is not really suitable for anything other than triggering UI events (also see manual). Ins$$anonymous$$d, Unity relies mostly on calling specifically named functions on $$anonymous$$onoBehaviour derived classes, such as OnTriggerEnter() or OnCollisionExit().

You might want to check out Send$$anonymous$$essage() and Broadcast$$anonymous$$essage(). There is a subtle difference between the two, explained here. Note that these methods don't support bubbling and that using them is somewhat discouraged due to performance issues.

A better approach may be an Observer pattern, though no default implementation exists in Unity itself.

avatar image
0

Answer by randytayler · Apr 27, 2015 at 02:55 PM

Seconded. How could you connect to prebuilt Flash libraries? I think you'll have to rewrite them as @another_kind said. Have you searched to see if what you're looking for already exists as Unity packages, or if somebody has built something similar for sale in the asset store?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Where to place main controller code? 2 Answers

Flash: read in variable from actionscript 0 Answers

New Input system not having the properties of an actionmap 0 Answers

Add Actionscript files building for Flash 1 Answer

how do an action onclick an object? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges