I cannot get the StageWebViewBridge to load external assets - flex4.5

I am using appfile:/. The path is correct; if I put it on screen and copy-paste it in the explorer it links to the image.
Is there anything else I need to do?

UPDATED I have updated the library, now is more easy to use. Can you test it?
I am the author of the StageWebViewBridge class. There is a known problem if you are using Android. Anyway, I have a working solution I will update the next week.
If the problem is not in Android, then send me some code.

I am also confused on how to access locally packaged assets. I put them in the HTML folder as requested and when I send a signal to the StageWebViewBridge to set the .src attribute of a video I'm not sure how to do it.
Without StageWebViewBridge and entirely in a website I can just reference the file for a video object via JavaScript directly e.g. swvRef.src = 'file.mp4';. This works perfectly fine. When I try to tell flash to send a call via StageWebViewBridge it does receive the call to the StageWebView (I have JavaScript reporting it). However when I try to set the .src of a video object I can't figure out the correct path.
The documentation says to put all things in a 'html' folder. I did so. No reference to a .src of 'html/a.mp4' or 'a.mp4' or 'htmlCache/a.mp4' ever makes the new javascript html5 video class work.
Bridge otherwise is working perfectly sending AS->JS and JS->AS. I'm just looking for info on how to reference packaged files. I want to play a video I put in the /html folder and so far, I just can't do it.

Got the same issue and fixed it with "appfile:/"
Why do you require "appfile:/ for a local html file ?
If the treated html/js/css is local and asset is relative (aka ../ or no http://) you should treat them as "appfile:/" ?
If the treated file is distant you do not have to handle assets ?
Is there a best practice to work with "appfile:/" ?
Actually I debug my html/js/css game in the browser but if I use appfile:/ it will no longer works. I will have to handle 2 behaviors.

Related

Use Dynamic Javascript in iOS Share Extension

I am developing a share extension for iOS 8 and it seem like i can run javascript code on page to grab some information like markup of the mage
But on the apple document it says that javascript code must be inside a .js file but my javascript code is coming from server and it is dynamic.
Is it possible to run javascript i downloaded from server or can I change js file contents everytime I need to use it?
You can't do this using the built-in support in the current share extension system.
The Javascript file needs to be listed by name in the extension's Info.plist, in the value of the NSExtensionJavaScriptPreprocessingFile key. The file named there needs to exist in the app extension's bundle. But bundles are not writeable, so you can't replace or change the file.
You might be able to do something like you describe if you:
Include a basic JS file that just returns the entire page source to your extension.
Use JavaScriptCore.framework to further process that data in your extension.
I don't know of any reason why that wouldn't work, but I haven't tried it, and it's kind of unusual. Still, given your needs, it's worth investigating.

Saxon CE 1.1 - Using result-document to create a output file

I've been playing with Saxon-CE_1.1 over the last few days and have managed to create a little application that allows users to classify pictures according to a data dictionary using a select dialog. All was going really well until I tried to use the result-document() function in it's "classic" way, to create a new file in the file system containing the choices the user has made.
XML Quire is returing with a severe error stating:
XpathException in mode: '{http:saxonica.com/ns/interactiveXSLT}onclick' event: [object MouseEvent]: Expected '?select=' ir '#' at start of result document href found "filename.xml
This error seems, to me, to be stating that I must pipe the results back into the HTML using # or ?select/
Is it still possible to create "external" output using SaxonCE? If so how can I accomplish the task.
Until recently it has not been possible to read or write files in the local client machine from Javascript code running in the browser, and if Javascript can't do it, then Saxon-CE can't do it either.
This may change soon with the HTML5 FileSystem API, but as far as I'm aware support for this is still very patchy. When it appears to be more stable and widespread, we can certainly look at implementing both doc() and xsl:result-document to access local filestore (or indeed, implementing the EXPath file module).

Display offline html5 website

For my business I need to be able to show a potential client a website I generate with a program called Pano2VR, which is a virtual tour program. This program takes some panoramic photos linked with each other and can generate a virtual tour out of them (as example: www.casas-fotoart.de/virtualtours ). The output this App gives can be either HTML5, Flash or both (flash if available and html5 for mobile devices, for example).
I need to be able to show that on my iPad while offline. i haven't found any solution for that so I tried to build a easy App for that, which I thought it wouldn't be complicated.
I generated a html5-only virtual tour and I droped the output into the "Suporting Files" group on the Xcode project. I added a UIWebView and on viewDidLoad I set it so it loads the html file.
The files I'm droping are like these (these inside the ipad folder):
The html file loads into the webView, but it just displays "This content requires HTML5/CSS3, WebGL, or Adobe Flash Player Version 9 or higher.", even though when loading these files from the net, it loads perfectly. I know this message comes from the html file.
Any idea on how to make it work will be much appreciated. Thanks in advance.
Your problem is this probably - XCode is mangling the JS files, I assume because it's trying to compile them

How can i turn a local website (directory on my PC) stored in a filder into a .webarchive file?

I have a full website html, css, images, javascripts and video on my local hardrive all contained in a folder.
the website works great on my PC but i need to transfer it to an iPad, i was thinking that this should be easy ... well its not since i cant just copy the site over and run it like on my PC.
so my next step was to try and make a .webarchive of the site but since it has a lot of jquery and video files i cant just use safari since it wont include any of the video files and so on.
was hoping someone knows of a tool or a method to convert a folder into a webarchive.
Just open the website over safari and then Save As... web archive.
My currently unsolved issue is exactly the reverse one.

Why my SWF file is so big?

So I'm pretty experienced with OOP (I like to believe) and I just started with Flash CS5 and ActionScript.
I created a new empty file and added a button to it. Nothing else, no code at all.
I set in the publishing options the "Default linkage" option to "Merged into code" to see how big the download will be for those who are loading it for the first time without cache and the size turned out to be ~500KB which is a far cry from the ~20KB it is with the shared libraries option.
So, why is my file so big? I thought all the features I'm using are built in the flash player and no external libraries are required to load?
Also, is there a way to see what external files my swf depends on to run?
If your button is the default Flex button (as opposed to creating your own using pure as3), then you're probably bringing in the the entire Flex lib. It's why I stopped using it :)

Resources