-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I have a SWF that tries loading something from the server but needs a param with a relative path to load from, something I'd pass as:
<param name="base" value="/my/relative/path/data.txt" />
Without this parameter it will always try loading from the browser URL, eg:
https://www.example.com/play-game/my-game-name,
... despite the SWF being at /my/relative/path/.
My code:
<script src="/awayfl/loader.js"></script>
<script>
const config = {
width: 800,
height: 600,
splash: '/awayfl/splash.png',
progress: { // optional
back: 'cover url(/awayfl/progressBack.png)',
line: #cc0022, // or image, it will passed to progressLine background,
rect: [0, 0.9, 1, 0.1] // x, y, width, height of preogress line relative contianer
},
baseUrl: '/awayfl/',
runtime: ['/awayfl/runtime.js'],
binary: [{
path: '/my/relative/path/example.swf',
resourceType: 'GAME',
name: 'Game', // not used atm
meta: {} // not used atm
}],
};
//window.addEventListener("load", () => {
AWAYFL.LegacyLoader.init(config);
AWAYFL.LegacyLoader.runGame((fill) => {
window.dispatchEvent(new CustomEvent('awayfl-player-progress', {detail: fill}));
}, (config, hideLoader) => {
const player = new AWAYFL.Player(document, config);
window.dispatchEvent(new CustomEvent('awayfl-player-init', {detail: player}));
player
.loadAndPlay()
.then((_, hide) => {
window.dispatchEvent(new CustomEvent('awayfl-player-load'));
hide && hide();
});
});
//});
</script>
Now this is just an example of a parameter, I understand there are redirects we can use for this particular situation.
How about other parameters that configure the asset?
How do I pass parameters to SWF files?
Metadata
Metadata
Assignees
Labels
No labels