Embed FLV as a specific class in FLEX - actionscript-3

In the Flash Authoring Tool, I can embed an FLV file as any class I wish as long as the class is a child of MovieClip. This is achieved by selecting the "Export for ActionScript" option and entering a MovieClip-extending "Base Class".
I need to achieve this with Flex too. How can I embed an FLV and make it be a MovieClip-extending class?

It sounds like you can't embed an FLV, based on these docs
To Quote:
You can embed any file type in a Flex application as a bit map array. However, Flex does not recognize or process files other than those described previously. If you embed any other file type, you must provide the transcode logic to properly present it to the application user.
It is even mentioned in the comments that this is a limitation. Your best bet, if possible, is to load the flv asset at runtime.
In aN AIR app [including mobile] you can the FLX as part of your distribution and load it from there. In a web app, just put it in the directory.

Related

Is there some Plone content type already available for HTML5 animations, videos etc.?

I have a Plone based site with some custom Archetypes-based content types. Now we feel the need to support HTML5-based animations etc. for new multimedia contents.
Is there some suitable content type already, or should we invent it on our own?
AFAICS, it will look like this:
There is some common createJs.js file somewhere which provides the API which is used for all HTML5 multimedia contents.
Each multimedia object features some Javascript code (which could be saved as a file animation.js somewhere)
The same directory which holds the animation.js file will contain all further resources needed, e.g. images.
The view HTML code will need to src the animation.js file (which will in turn "create" the animation).
So, is there some object type already I should use?
If there isn't - should I put everything into the ZODB, or would it be better to store the resources plainly in the server file system (and let Apache serve them more or less directly)?
For video and audio you can just use the File content type and modify the templates to use the HTML5 video and audio tags, which make use of browser-built-in video and audio players.
plone.app.contenttypes is doing that, but this is Dexterity based. However, it can give you some hints: https://github.com/plone/plone.app.contenttypes/blob/master/plone/app/contenttypes/browser/templates/file.pt
Also, you have to provide the video and audio files in a web-suitable format: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
For custom JavaScript code you rather need a custom Plone application. For that you do not need a specific content type except a custom content type if you need animation-specific configuration options to be passed to the JavaScript. Otherwise a simple view which includes the JavaScript will do it. For more information on these topics consult the Plone documentation: https://docs.plone.org/4/en/develop/plone/views/browserviews.html
Disclaimer: The docs above refer to use Grok, which I would not recommend as this is not have Plone core support. We need to get the docs updated there.

HTML Hyperlink to a specific scene in a swf file

I have an swf file with many scenes. I would like to be able to add multiple hyperlinks to a company Intranet site (set up on SharePoint) that link to specific scenes in the swf file. Is this possible? Thank you!
It's do-able... it's going to depend on how much access you have to the actionscript, the javascript, etc. In short you'll need to be able to add the necessary listeners required to do what you want to do.
I found an example of communication between JavaScript and Flash here: http://code.tutsplus.com/tutorials/quick-tip-how-to-communicate-between-flash-and-javascript--active-3370
Yes, first you need to setup deep-linking in your SWF. Check out swfaddress. This will make it easier to create deep-links (using the browser address hash) into your SWF file. For example, a url such as my/site.html#scene3 could gotoAndPlay(1, "scene3") in your SWF. Swfaddress has various examples to get you started.
Once you have your swf setup to support deep-linking, you can simply create HTML links with the desired url, like <a href="my/site.html#scene3">.

Is it possible to embed an mp4 movie in an AS3 project? (no netstream)

I need to embed a movie file into an AS3 project and play it. I've only used NetStreams before, but since I want to have it as an embedded resource this time, that won't be necessary.
I know it's possible for MP3's and other resources, but can't find any clear info on video like mp4.
It's hard to google the problem because of the ambiguity of the word 'embed'
You can embed anything as binary data using metadata like this:
[Embed("file.mp4", mimeType="application/octet-stream")]
And then you can get that data as ByteArray at runtime. So if you can use byte array for playback, then yes, it is possible.

ActionScript don't load HTML resources with HTMLLoader

I'm currently downloading website via an ActionScript HTMLLoader to later have access to the DOM to get some information out of the page.
The problem is: each resource that is linked on the page (images, stylesheets, javascript) is also loaded which takes some additional time. I don't really need those resources, because only the plain HTML/DOM is interesting.
Is there any way to disable loading of linked resources? At first I tried using an URLLoader and parse the result as XML, but when the website isn't valid this doesn't work. I also didn't find a library that validates/parses a given HTML-string into valid XML.
I'm using Adobe AIR on desktop.
Perhaps convoluted, but you could load the file with URLLoader, convert it to a string, use regex to remove links to the external resources you don't want, and then load the result into the HTMLLoader.

Flash CS5 compiler options broken?

(Haven't received any love on Adobe forums, so trying this here)
So, I've formally logged a bug against this with Adobe as I've been beating my head against a wall trying to understand why this won't work, but I'm hoping that it's perhaps something within the Flash IDE that I'm setting incorrectly (or not setting at all) that is causing the issue that I'm encountering:
I've created a container .fla that uses classes that are defined in an externally loaded swc, child.swc. I've added the .swc in the container's library path (Publish Settings > AS 3.0 Settings > Library Path) and have set its "Link Type" as "Exernal". According to Adobe's docs:
"External: The code resources found in the path are not added to the
published SWF file, but the compiler verifies that they are in the
locations you specified."
However, when using FlashDevelop's swf browsing utility after publishing the fla (and having used a reference to the class in the container class), I see that the class definition is still being added to container.swf.
Now, if I use compc and mxmlc with the appropriate options (-link-report and -load-externs), I can exclude child classes as needed and all functions as expected. However, when setting what seems to be the same options in the Flash IDE, it does not provide the same output. Unfortunately, I have some use cases where the use of the Flash IDE is essential, so a workaround would be painful.
Is this a known issue, or is there something that I'm just doing wrong (or are my expectations incorrect) in the IDE?
Thanks in advance.
have you made sure, that these classes are not accidentally included in your source path?
Also, try setting the flex sdk in the Flash IDE (Settings > ActionScript > ActionScript 3.0 Settings). Then try again publishing, it will now use the flex compiler.