Can any Flash compiler put specific scripts on specific frames of the Flash movie SWF?
Like you can do from within the Flash IDE, just place a script on the required frame using the Timeline panel, and the script gets compiled to that frame of the Flash movie SWF.
Eg. script on frame 1 :
trace("Reached frame 1");
Eg. script on frame 2 :
trace("Reached frame 2");
SWF Compilers: (Hopefuls)
AS3 Compiler - Haxe
AS2 Compiler - MTASC
Adobe Flex Compiler - Mxmlc
C# to SWF Compiler - Debreuil
It's possible with the MXMLC, though it not very well documented.
A Google Search for Flex Frame Metadata will show you the code. A little trial and error and you should be able to get something working. (This is how the flex preloader works)
As far as I know, none of the compilers you mentioned manages a timeline based execution. But swfmill may help here. I advise you to compile your own binaries because the precompiled binaries are pretty outdated and lacks important fixes.
Both MTASC and Haxe let you 'inject' code into a specific frame of an existing swf. The usual process is to create a library swf using SWFMill that contains all your assets. After that you inject your code with either one of the compilers into that swf resulting in a new swf.
After injecting code into frame 1, try also injecting code into frame 2 as a next step. In theory this should work. I haven't tried this myself so you might want to experiment with this.
There is a small haxe written neko tool that allows you build multiple frame swfs:
http://gamehaxe.com/2009/02/04/haxe-preloader-for-flash-written-in-haxe/
maybe you can also have a look at the undocumented function
addFrameScript(frameNumber,function,frameNumber,function...)
what about using ASC opensourced in FLEX sdk,
you could use it for compilation and then envelope the resulting abc into DoAbc tag and put into desired frame with any library that handles swf file format.
Related
I want to download the 3D Object-dae(collada) file from server and want to display on surface dynamically so can please share how can I achieve this in ARKit via SceneKit or else?
You can check this link: https://the-nerd.be/2014/11/07/dynamically-load-collada-files-in-scenekit-at-runtime/ it is old post but I don't think something is changed since that
According to this (see the Discussion section): https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension?language=objc
dae is not supported at runtime (ModelIO).
Additionally I'm working on a library called AssetKit (In Progress) and it will full support COLLADA and glTF, it is too early to say that but after initial release, you will be able to load dae files dynamically. It is written with C99 but I'll optimize it for Swift (by writing wrappers or integration with SceneKit...). Since it is still in progress I suggest that follow the first link
I've been trying to load a library into lua file. Sparing the details, as they are not really important, I have tried this many ways.
The final way, and the one I believe to be correct although I still can't get it to work, is to use "package.loadlib". See code:
ed = package.loadlib("Encode_Decode.lua", "luaopen_ed")
print(ed)
But when I run the program I get this error:
Encode_Decode.lua is either not designed to run on Windows or it
contains an error. Try installing the program again using the original
installation media or contact your system administrator or the
software vendor for support.
I know the program runs because I used it internally to test it's encoding and decoding abilities and it worked fine. I'd really prefer not moving the contents of the library over as my main lua file is crowded as it is. I will if I have to though.
Yes it is in the main folder. I've also tried changing the extension of the library file into a .dll, with the same error.
What am I doing wrong?
I apologize in advance if this is a duplicate, I did my best to research this problem as thoroughly as I could. But to be honest it's almost 3 AM and I've been searching for almost an hour.
Stupid beginner mistake, used the wrong syntax.
require("Encode_Decode")
print(dec("bnVs")) --returns "nul"
package.loadlib is used for loading shared libraries; i.e. .dll or .so files. You're passing a .lua file to it, so Windows attempts to load it as a .dll and fails when it can't.
To load Lua source code, you can use dofile. Alternatively, you can use require, which is a bit more complex, but handles loading modules only once and works with both Lua and C modules.
It is possible using AudioUnits on iOS to create samplers that load and play soundfont (or SF2) files. This is a really great feature. The problem is that I don't see any interface for inspecting a soundfont to see: a) how many presets it contains and b) the names of the presets it contains.
It is possible to obtain the current preset name by first loading the soundfont into the sampler using AudioUnitSetProperty with kAUSamplerProperty_LoadInstrument and then calling AudioUnitGetProperty with kAudioUnitProperty_ClassInfo on the sampler. This is not very efficient however, and only tells you the name of the currently loaded preset. It also does not seem to tell you how many presets are contained in the soundfont.
How does one do these things without using 3rd party code (surely it is natively supported)?
Another option is a soundfont editor for OSX called polyphone
This is a very old question, but I do have another solution: my SoundFonts
application. It is available on the AppStore for a small fee, or you can use the source to build what you want.
The repo contains an SF2 parser in C++ that I reworked from some code I found online. The repo also contains a catalog.py Python script that generates listing from a SF2 file. It uses the sf2utils Python package.
I swear I have been looking for the answer to this question exhaustively, but I found no real solution to my problem. And what problem is that?
Well I am new to DirectX and shaders. There are a few things about shaders that I still don't get.
1 - How to make a shader? Do I have to create an .fx file in the project? Some times it is so, but in some examples I can't find any .fx file. And how do I make this file? My version of Visual Studio can't directly create .fx files; I have to "force" the file to be .fx.
2 - How I compile them? Are they compiled at the same time I compile solution or they have special ways to compile?
3 - Is there a nice tutorial around? I have been looking for a shaders-bible but mostly I found vague and short tutorials explaining few things, and never in a deep way.
1. New to Shader ?
To get the introduction to sharder use the free shazzam shader editor (http://shazzam-tool.com/) for creating the simple shaders by interactive draw tools. Try to play with different option and then compare the automatically generated HLSL(.fx) codes for better understanding. After you got the feel of how the shader code to be written buy a standard book/online tutorial and practice to write your own code according to your requirements.
2. Common Methods for compilation:
a. D3DXCreateEffectFromFile- Write the shader code and save in .fx extension and dynamically compile the code by D3DXCreateEffectFromFile. Compiled code can be used in your core module using effect(ID3DXEffect) interface.
b. Explicit Compilation: Write the shader code and save in .fx extension and explicitly compile the code using fxc.exe (You can find in DirectX SDK Utility folder).
Example:
fxc.exe /Tfx_2_0 /Fo file.fxo file.fx
After binary file is created follow as below
1. Create a buffer and load the generated binary file(.fxo) by the file stream.
2. Call D3DXCreateEffect and give the buffer content as a input parameter.
3. Like "method a" use effect(ID3DXEffect) interface for interacting with the
shader code.
3. Introduction Tutorial:
http://rbwhitaker.wikidot.com/hlsl-tutorials
Shaders are just like normal text files you put your shader code in them. You don't need to add them to your project if you are compiling the shader at runtime with the D3D functions.
There are two ways to do this. One is putting your shader code in .fx files or *.hlsl files and then compiling the shader at runtime using D3D library functions (D3DCompileFromFile). Though Microsoft is not suggesting this anymore because D3DCompileFromFile won't work in Metro style apps. The other way is to use fxc.exe to compile your shaders at build time. Visual Studio 2012 made this process part of the usual build. So you can add your hlsl files into your project and they will be build when you build your project. This will also enable you to see any errors/warnings in the shader at compile time.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb509633(v=vs.85).aspx
Hope that helps.
For the record, I am an iOS developer, and have absolutely no background on how flash programs work/run/developed...etc.
I have a Flash program that is mostly a collection of SWF files. It does, however, contain some Actionscript, Javascript and other integrated languages here and there..
I would like to convert this project/program to an iPad application. Is it possible?
What I got from searching the net:
Converting Actionscript to LUA script
Using Corona SDK to port the program to iOS
Starting a new iOS project in flash and moving the code somehow..
Other tedious ways which are not feasible at all....
The above mostly handles the actionscript part .. what about the SWF files?
As a last resort, one could at least guide me to a developer/company who can handle this task, or provide training to accomplish this.
Additional details
The flash program app file is already generated, and the program works on desktops perfectly. The program is somehow an interactive e-book, and it has some linked XML files to index the table of contents and other sections...
I've not done a lot of iOS development yet, but here are my experiences so far; maybe they help you form a better idea.
Only the main SWF can contain actionscript code.
I'm not sure how far assets (Sounds, Fonts, MovieClips) in other SWFs which are exported for actionscript are accessible to the main SWF.
It is possible to include additional XML files (and other types) which can be loaded via the normal loader classes.
Recently I came acrosshe tool which allows you to convert and play swf to some cross-platform frameworks. Now they support only Cocos2d-x, Unity 3d and Starling. But I saw the logo of Corona on their homepage. You can go there and ask them. I don't remember the right name of the site, but tool is called GAF converter