=================================
=================================
=================================
출처: http://forums.adobe.com/thread/1109860
Since it seems you (Adobe) are still trying to convince developers to use Flash to make games, I am going to insist in a question I asked some months ago without success. This has been a huge problem for us (and many others) so, please, don't ignore it again:
At my company we are developing a beautiful game that uses a lot of vectorial graphics and will be released for iOS, Android and Windows. Flash should be a great tool for us. However, we can't use Adobe Air to run our game on iOS because we can't (or don't know how to) load the assets that we pack in .swf files as we always have done. We aren't trying something too unusual, we are just using the "export for ActionScript" option in the Flash IDE.
Luckily, Autodesk released Scaleform for mobile which doesn't have that issue and, by the way, improves the performance and the antialiasing we get with Air. We switched to Scaleform and we have almost finished the game so, if nothing changes on your side, we will stay with them.
So, my questions are:
- Is it really true that you can't load assets (MovieClips) in .swf files using the "Export for ActionScript" option on iOS?
- If you can't... Why on earth isn't it possible? We can do it with Scaleform so why not with Air? Are you planning to support this sometime?
- If you can't... How do you want us to work? Our game has thousands of animations. Are we supposed to have each animation in a different .fla and export each animation to different .swfs??
- If we're wrong and you actually can... I'm sorry, we really tried and we couldn't make it. Please, tell us how.
4152 Views 6 Replies Latest reply: yolque, Dec 19, 2012 4:10 PM
Was this helpful? Yes No
Correct
Dec 4, 2012 2:41 PM
Hi mSantirso,
Sorry for not answering these questions earlier. Let me provide you some details. I hope it helps.
First, it would be great having you guys use AIR on iOS, like many companies using today Stage3D on mobile devices with Starling for instancem your games could run beautifully on mobile devices.
Here is a list of recent games for example using AIR/Starling on iOS today:
Letter by Letter: https://itunes.apple.com/us/app/letter-by-letter-free/id572207781?ls=1 &mt=8
Ruby Blast: https://itunes.apple.com/us/app/ruby-blast-free/id515361019?mt=8
Smart Aliens: https://itunes.apple.com/us/app/smart-aliens-premium/id568032383?mt=8
To answer your questions:
- Is it really true that you can't load assets (MovieClips) in .swf files using the "Export for ActionScript" option on iOS?
Yes, it was a limitation in the past. We solved this in AIR 3.6, now you can package multiple SWF with your app. You can then use the class linking option (Export for ActionScript) and extract these definitions at runtime.
AIR 3.6 will be posted on Adobe Labs this week as a beta. So you should be able to use it and let us know if it works for you.
- If you can't... Why on earth isn't it possible? We can do it with Scaleform so why not with Air? Are you planning to support this sometime?
Yes, as I said, AIR 3.6 will provide this functionality.
- If you can't... How do you want us to work? Our game has thousands of animations. Are we supposed to have each animation in a different .fla and export each animation to different .swfs??
An alternative is also the use of spritesheets, which can be limiting but there are some good things happening on that side, like with Dragon Bones, a new Starling extension: dragonbones.github.com
- If we're wrong and you actually can... I'm sorry, we really tried and we couldn't make it. Please, tell us how.
You are not, you faced a limitation and we did not expose a solution for this in the past. Give AIR 3.6 a try and let me know. I really hope you guys will be successful using the tools and workflow you know with AIR. Thanks for reaching out!
Thibault
Was this helpful?Yes No
Replies
Report
Ruby Blast: https://itunes.apple.com/us/app/ruby-blast-free/id515361019?mt=8
AIR 3.6 will be posted on Adobe Labs this week as a beta. So you should be able to use it and let us know if it works for you.- If you can't... Why on earth isn't it possible? We can do it with Scaleform so why not with Air? Are you planning to support this sometime?Yes, as I said, AIR 3.6 will provide this functionality.- If you can't... How do you want us to work? Our game has thousands of animations. Are we supposed to have each animation in a different .fla and export each animation to different .swfs??An alternative is also the use of spritesheets, which can be limiting but there are some good things happening on that side, like with Dragon Bones, a new Starling extension: dragonbones.github.com- If we're wrong and you actually can... I'm sorry, we really tried and we couldn't make it. Please, tell us how.You are not, you faced a limitation and we did not expose a solution for this in the past. Give AIR 3.6 a try and let me know. I really hope you guys will be successful using the tools and workflow you know with AIR. Thanks for reaching out!ThibaultTranslate- Was this helpful? Yes No
- Yes, it was a limitation in the past. We solved this in AIR 3.6, now you can package multiple SWF with your app. You can then use the class linking option (Export for ActionScript) and extract these definitions at runtime.
- - Is it really true that you can't load assets (MovieClips) in .swf files using the "Export for ActionScript" option on iOS?
- To answer your questions:
- Smart Aliens: https://itunes.apple.com/us/app/smart-aliens-premium/id568032383?mt=8
- Letter by Letter: https://itunes.apple.com/us/app/letter-by-letter-free/id572207781?ls=1 &mt=8
- Here is a list of recent games for example using AIR/Starling on iOS today:
- First, it would be great having you guys use AIR on iOS, like many companies using today Stage3D on mobile devices with Starling for instancem your games could run beautifully on mobile devices.
- Sorry for not answering these questions earlier. Let me provide you some details. I hope it helps.
- Hi mSantirso,
- Dec 4, 2012 2:41 PM in reply to mSantirso
- 1.imbert.thibault,
ReportWe will try AIR 3.6 but it's probably too late for us because our game is almost finished. Also, I think you're focusing too much on 3D and sprites while the strongest point of Flash is its great support for vectorial graphics and animations.
- App file size: Our publisher won't let us go over 50MB, with sprites we would be well above that number
- Device resolutions: The same assets look perfect in the iPhone 3, in the iPad 4 and in any resolutions that will come
- Changing colors at runtime: We can easily customize the colors of the characters clothes in one line of code
- Authoring workflow: The work our animators do is directly applied to the game without any transformation process
Was this helpful? Yes No- Translate
- One of the things I liked from Scaleform is that they share this view and they are focusing on improving the performance and the rendering quality when using vectorial graphics. In my humble opinion, I think that's where Flash can surpass the other many options available for game developers.
- Also, allow me share a personal opinion: I think that you (Adobe) are focusing too much on 3D and sprites. If I wanted to create 3D games I would probably use Unity (for instance) and if I wanted to create 2D games with many small objects bouncing and moving around the screen I would use Cocos 2D or any other option (not Flash!). The strength of Flash is how well it supports vectorial graphics and animations. There's no other technology that competes with Flash in that area... And it's a very important area! We are avoiding many headaches by using vectorial graphics:
- About the spritesheets option... If you have seen the video of our game, you will instantly know that that would be impossible; we have too many animations too large and long to fit in as spritesheets. Dragon Bones looks great but, as many other similar options, it seems a bit too soon to jump on that new technology. Perhaps for our next project!
- It's great news that you are finally addressing this issue. Better late than never. We will definitely try it as soon as it's in the labs. Do you know when will the AIR 3.6 be released (not beta)? As I said, our game is almost finished so perhaps it'll be too late for us...
- First of all, thanks for replying, it's very important for us (developers) to be able to contact with you directly. It has not been easy in the past but it seems you're willing to change
- tl;dr
- Dec 5, 2012 11:04 AM in reply to imbert.thibault
- 2.mSantirso,
Report
To allow developers to query graphics objects from display objects, super powerful for many different use cases!For info, this is what the PS Touch team is doing on their app (built with AIR), they use a single SWC containing the vector assets and everything is scaled and rasterized at runtime depending on the device resolution. Best of both worlds! Scalable graphics and GPU acceleration. We are currently prototyping runtime compressed texture compression so that people can do that and also leverage DXT, ETC and PVRTC compression for the textures. We know that spritesheets are very limiting and this is definitely not where we want to go in the future.Let us know how it goes with AIR 3.6, you know where to find us now ThibaultTranslate- Was this helpful? Yes No
- I also totally agree with you that the strength of Flash is in scalable vector graphics, hence why I pushed really hard for this recent addition in Flash Player 11.6/AIR 3.6: http://www.bytearray.org/?p=4893
- It is also very interesting you mention we focus too much on 3D, actually it can be perceived that way, but we are actually not, we take 2D very seriously and that's why we created Starling to provide a fast 2D framework for game developers. Given the DNA of Adobe (being mainly 2D), we are really looking at making the integration tighter with tools like Flash Pro for instance in the next versions.
- Thanks for giving it a try! AIR 3.6 will be released around February. But you can publish your app to any app store with the beta version, we removed the watermark restriction, so you should be able to publish an app with 3.6 sooner.
- Hi mSantirso,
- Dec 6, 2012 11:38 AM in reply to mSantirso
- 3.imbert.thibault,
Report
- Downloaded AIR SDK 3.6 and uncompressed it, "overlaying" the existing SDK
- I created a new Flash Builder 4.7 actionscript mobile project (Flash Builder confirmed I was using AIR 3.6)
- I wrote the following code:
- I downloaded AIR SDK 3.6 to try this. I couldn't make it work. This is what I did:
- Hello again,
- The most obvious use case is a game in which the assets for each level are packaged into one .swf. Then you would load the assets when the player enters a level, unload them when he changes to a different level. But, obviously, I would need to reload the first .swf if the player decides to play the same level again in the same session.
- If I understand correctly, that makes this new feature completely useless :S The whole point of loading multiple swfs is being able to load resources “on demand” and unloading them when you don’t need them.
- reloading a SWF will not be allowed for AIR apps for iOS in AOT mode
- Now I have another doubt. I read http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-m ultiple-swfs-in-air-apps-on-ios/ and saw this:
- As expected, it was my fault. I needed to add -swf-version=19.
- Dec 14, 2012 1:04 AM in reply to imbert.thibault
- 4.mSantirso,
package
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.net.URLRequest;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
public class prueba_loader extends Sprite
{
private var aLoader:Loader;
public function prueba_loader()
{
super();
// support autoOrients
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
aLoader = new Loader();
var url:URLRequest = new URLRequest("assets/test.swf");
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
aLoader.load(url, loaderContext); // load the SWF file
aLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderFinished);
}
protected function onLoaderFinished(event:Event):void
{
var testClass:Class = ApplicationDomain.currentDomain.getDefinition("Test") as Class;
var test:MovieClip = new testClass();
addChild(test);
}
}
}
- 4. Tested the project with the AIR simulator and confirmed it worked as expected
So, is that supposed to work? Am I doing something wrong?Translate - Was this helpful? Yes No
- I get this error twice, one just by loading the .swf file and the other when I call getDefinition). Then, when I pause the debugging session, an "Uncompiled ActionScript" warning appears on the iPad Screen
- ReferenceError: Error #1065: Variable Test is not defined.
- 5. Launched it on iPad, got the following error:
Report
Sr. Product Manager | Adobe GamingTranslate- Was this helpful? Yes No
- Thibault Imbert
- Sorry for this limitation!
- This feature is a step in the right direction though, SWF reloading is an improvement we can consider in the future. I will follow up on this to see when we could provide such an improvement.
- So good news you got it working, but bad news this limitation is a showstopper for you. It is true that in the context of a game, reloading the SWF is key.
- Hi mSantirso,
- Dec 17, 2012 4:13 PM in reply to mSantirso
- 5.imbert.thibault,
Report
2. Everything works as expected in adl, and also if I do "fast" packaging for iOS. "Standard" packaging or "Export Release Build" won't work on a real iPad, however, they DO work when I install them in iOS Simulator! I've tried with an iPad 1 with iOS 5 and an iPad 3 with iOS 6.
ReferenceError: Error #1065: Variable UnityLogo is not defined.ReferenceError: Error #1065: Variable UnityContent is not defined.ReferenceError: Error #1065: Variable UnityNative_dataSegmentBytes is not defined.ReferenceError: Error #1065: Variable ProjectSerializedFileContainer_Resources_unity_default_resources is not defined.ReferenceError: Error #1065: Variable ProjectSerializedFileContainer_sharedassets0_assets is not defined.ReferenceError: Error #1065: Variable ProjectSerializedFileContainer_mainData is not defined.
Was this helpful? Yes No- .mikko.
- Thanks in advance,
- Am I doing something wrong or did I just bump into another limitation?
- ...and after that it crashes. The iPad displays the notorious "Uncompiled ActionScript - Your application is attempting to run uncompiled ActionScript, probably due to the use of an embedded SWF. This is unsupported on iOS." message.
- [SWF] assets/UnityFlash.swf - 16,854,863 bytes after decompression
- 3. I did a "standard" packaging with debug, these are the errors I get in console:
- 1. First of all, when you publish content from Unity, it generates an embeddingapi.swc (in earlier versions called UnityShared.swc), which contains a few helper classes to handle the loading of Unity content (see http://docs.unity3d.com/Documentation/Manual/flash-embeddingapi.html). I decompiled the swc, so I could modify the UnityContentLoader.as (which extends Loader) and add the ApplicationDomain.currentDomain stuff in it.
- I'm trying to load Unity 4 generated content into a main SWF app using this new AIR 3.6 feature. But it fails on iOS. Here's what I'm doing and what happens:
- Hi Thibault,
- Dec 19, 2012 4:10 PM in reply to imbert.thibault
- 6.yolque,
=================================
=================================
=================================
'ADOBE > ActionScript' 카테고리의 다른 글
[AS] 액션스크립트 텍스트 필드에 이미지 사용 (0) | 2020.09.22 |
---|---|
[AS] swc 안의 class를 getDefinition, getDefinitionByName 으로 불러내기 관련 (0) | 2020.09.22 |
[AS] 로드한 SWF 내부에 작성된 ActionScript 클래스 이름 찾기 관련 (0) | 2020.09.22 |
[AS] air for iOS에서 swf reload는 지원하지 않는다. 관련 (0) | 2020.09.22 |
[AS] 플래시 액션 스크립트 stageWebView 에서 flash와 html간의 데이터 통신방법 관련(pc, 모바일) (0) | 2020.09.22 |