• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE [SOLVED/BUGGY] Importing SWFs with multiple Frames into Sprites?

A

Anomaly

Guest
Hi,

I've been exporting my single frame SWF vector files from illustrator into sprites in GMS2 just fine.

Now I have files with multiple layers in illustrator, and export to SWF with the "export layers to SWF Frames" option selected.

When I import those into a sprite in GMS, I only get one frame imported, nothing more. Is this a bug, or is it not possible to import multi frame vector files as multiple frames in a sprite?

Thanks!
 

JackTurbo

Member
I've been playing around with swf's for some of my UI elements recently and encountered this as well.
From my experience I've found that its usually due to the swf including a feature that GMS doesn't like.

Does you illustrator file include by chance any of the following; clipping masks, gradients, raster effects (like drop shadows) or complex stroke brushes?

Essentially you want to simplify your vector files down so that they're just vector paths with fills. Expand any strokes, use the pathfinder to clip stuff rather than clipping masks, forgo gradients or raster effects etc...

Also I'm not 100% sure what SWF version illustrator exports to, I've been importing my .ai files into adobe animate (flash CC essentially) to make sure they're are version 11.6 or lower (as per GMS docs).

Doing all this they work as you'd expect.
 
Last edited:
A

Anomaly

Guest
Mine are just image traced psd's.
Zero editing in illustrator.
Then I export to flash 9 (highest)

Are you saying that you HAVE gotten multiple frame SWFs to import into multiple frames of sprites?
 

JackTurbo

Member
Yes. I have a number of multi-frame swf sprites in my game that I am able to animate or manipulate the, using image_index just like a normal raster sprite. Including one with 50+ frames.

However, while I am drawing them in illustrator I am animating them in Animate CC and exporting to swf from there.
 
A

Anomaly

Guest
i imported then exported through Flash Professional CS6 at flash version 11.2.
still no dice.
haven't used flash in a long time.. (used to ALOT in the early 00's) ..
do i have to select the frames in the timeline of the ones i want to include in the swf or something?

EDIT: woops that's 11.2 (TWO) ... does it have to be 11.6?
 
A

Anomaly

Guest
Also I'm not 100% sure what SWF version illustrator exports to, I've been importing my .ai files into adobe animate (flash CC essentially) to make sure they're are version 11.6 or lower (as per GMS docs)..
where in the docs does it talk about flash version number?

i'm viewing...
https://www.yoyogames.com/blog/25/v1-3-vector-sprites
and
https://docs.yoyogames.com/source/d...re about sprites/importing vector images.html

but mostly
this - https://help.yoyogames.com/hc/en-us/articles/216755938--GMS-S-Vector-Sprites
https://help.yoyogames.com/hc/en-us/articles/216755938--GMS-S-Vector-Sprites
haven't seen any mention of flash version 11.6 or lower..
again I'm exporting at 11.2 and still just one frame when i import.

no animations.
i want to get busy!

frowwwwnyyy faaacccceee
 

JackTurbo

Member
Think its mentioned in the IDE itself now I think about it.

But anyway, 11.2 is lower so I think that should be ok. If you're still not animating then there must be something in your file that GMS isnt liking. I took me a bit of trial and error to get a workflow that worked.
 
A

Anomaly

Guest
Hmm well I turned off audio in my export...
Turned off everything else in advanced options for publishing the export...

Anyone else have any suggestions as to what may be at play here?

JackTurbo, would you mind me sending you or posting my 2 frame swf so that you might open it in your CC animate, then re-export it so that I might see what results I get when bringing in your exported file into my sprite?
 
A

Anomaly

Guest
Hmmmm nevermind. Thanks tho, got it covered.

I got access to a flash CC version and made a fresh 5 frame version with my ai file and exported it at flash 11.6 ... Still no dice.

Helooooo Tech Support?
Any advice? Something I'm missing?
 
A

Anomaly

Guest
Think its mentioned in the IDE itself now I think about it.

But anyway, 11.2 is lower so I think that should be ok. If you're still not animating then there must be something in your file that GMS isnt liking. I took me a bit of trial and error to get a workflow that worked.
I don't see the flash version requirement mentioned anywhere in the IDE.
are you using 1.4 or 2?
 

rIKmAN

Member
@Anomaly
I use GMS2 and the swf 11.6 error is given in the output console when you try to run the game.

Also, I can get swf animations working and manipulate them using image_index and image_speed etc, but they don't show up as separate frames in the Sprite editor.

I'm not even sure that's supposed to be possible as they are just like Spine sprites where you see the base frame and cannot edit them inside GMS anyway - as they would then become pixel sprites.

I ended up giving up trying to use swf in GMS2, there are just too many drawbacks and restrictions to make them useful for me. I had a 64x64 tile Sprite placed into a room on an asset layer 20 times giving me ~50 texture swaps, because I dared to use a gradient.

Unless it's for simply coloured cartoony style stuff, it's not usable IMO.
 
Last edited:
A

Anomaly

Guest
OK

PROBLEM SOLVED!

When importing bitmaps to sprites, I'm used to seeing all the frames visible at the top of the sprite's widow.

I was expecting the multiple frames of my vector SWF to appear the same way.
This doesn't happen, probably due to the fact that vectors don't get opened with the raster based image editor.

When you import multiple frame vector SWF files, you WILL NOT see more than ONE frame in the sprite properties window.... But they ARE THERE.

This is misleading / confusing as this thread can attest to (should be fixed)

I had a hunch that this was the case, so just made an object, assigned it the sprite with the multi frame vector SWF to it... Tossed it in my start room... And presto... Works fine... Straight out of illustrator layers to SWF Frames...all good.

I think this little hurdle that held me up for three days should be made aware to developers at large...
As I think people will think they're not getting the animation frames when they don't see them displayed in the sprite properties window.
 
A

Anomaly

Guest
@Anomaly
I use GMS2 and the swf 11.6 error is given in the output console when you try to run the game.

Also, I can get swf animations working and manipulate them using image_index and image_speed etc, but they don't show up as separate frames in the Sprite editor.

I'm not even sure that's supposed to be possible as they are just like Spine sprites where you see the base frame and cannot edit them inside GMS anyway - as they would then become pixel sprites.

I ended up giving up trying to use swf in GMS2, there are just too many drawbacks and restrictions to make them useful for me. I had a 64x64 tile Sprite placed into a room on an asset layer 20 times giving me ~50 texture swaps, because I dared to use a gradient.

Unless it's for simply coloured cartoony style stuff, it's not usable IMO.
Hah, you posted this just as I was writing my last post.
Yep they should make the frames visible no doubt!

My vectors are not fancy so I'm going this route.
Thanks for the input!
 
A

Anomaly

Guest
It does actually mention that you will only see the first frame when importing swf in the docs: https://docs2.yoyogames.com/source/...information/importing_non_bitmap_sprites.html

Good luck! :)
ok YES.....
it'a been there since the beginning...

"When importing a *.SWF file, Actionscript is not supported, so if your SWF relies on it to work correctly then it probably won't turn out right. Similarly, any embedded movie clips that have their own timeline will only have their first frame shown throughout the animation - all animation must be on the main timeline."

this should be highlighted in the literature...
and ... "movie clips" ?? a bit more exact to.. "SWF vector files with multiple frames"... would be useful identification...

all i'm saying is it's importance in having new users that want to use this valuable feature in the future not be confused about it anymore than i was by simply missing a minute scrap of manual material you had to research about to find your fault...

...streamlining?...

i've found other people be perplexed with this issue numerous times so let's make it a major instructional factor to help paying devs.

anyway.. i'm out and am going to enjoy my newfound vector freedom kthnxbye
 

rIKmAN

Member
Similarly, any embedded movie clips that have their own timeline will only have their first frame shown throughout the animation - all animation must be on the main timeline."
My understanding is that the text you quoted relates to actually playing back animations in game, not being displayed in the editor.

All animations must be on the main timeline, not embedded inside their own movie clip timelines (and then those placed on the main timeline) or else they will just display the first frame and not play back properly.

It doesn't make sense that every frame of a vector animation would be loaded and displayed inside the sprite editor, they are completely different formats.

That's how I understand it anyway, and how it has seemed to work for me so far.
 
A

Anomaly

Guest
My understanding is that the text you quoted relates to actually playing back animations in game, not being displayed in the editor.

All animations must be on the main timeline, not embedded inside their own movie clip timelines (and then those placed on the main timeline) or else they will just display the first frame and not play back properly.

It doesn't make sense that every frame of a vector animation would be loaded and displayed inside the sprite editor, they are completely different formats.

That's how I understand it anyway, and how it has seemed to work for me so far.
wait so in your past experience...

when you've had raster/bitmap frame sequences (say maybe taken from a STRIP)...
and SEEN the frames all aligned above in the sprite properties window...

you've ALSO seen the same exhibition with images of frames imported from vector SWF frames files?
 

rIKmAN

Member
wait so in your past experience...

when you've had raster/bitmap frame sequences (say maybe taken from a STRIP)...
and SEEN the frames all aligned above in the sprite properties window...

you've ALSO seen the same exhibition with images of frames imported from vector SWF frames files?
Erm...no - you've literally just said the exact opposite of what I posted.

As it says in the manual, swf sprites must have any animation in the main timeline and NOT embedded in movie clips (which can contain their own animation timelines inside them) as GMS will just display the first frame of these throughout the entire animation it will play from the main timeline.

You seem to be confusing this with swf frames being displayed inside the sprite editor, which is not what it's talking about.

For example, let's say you make an animation of a clock with its hands at 12:00, and each frame after that the hands move to simulate time passing - this is embedded into a movie clip on its own timeline.

You place this movie clip onto the main timeline and animate the clock x/y position in the main timeline, then export as swf.

When GMS plays this back the clock will move around the screen as the x/y position was animated on the main timeline of the swf file, but the clock will only ever display 12:00 because the animation of the hands moving is embedded inside the movie clip timeline - and only the first frame of these will ever be shown throughout the animation.

This is exactly what it says in the manual.

The sprite editor deals with pixel / raster / bitmap images (whatever you prefer to call them), so it doesn't make any sense that a vector sprite would have its individual frames displayed in the editor as they are completely different image formats.

TLDR: It only displaying 1 frame inside the sprite editor for swf sprites is the correct / intended behaviour and not a bug or something you are doing wrong.
 
Last edited:
A

Anomaly

Guest
are you talking about timelines in flash? that are translating to GMS?
Erm...no - you've literally just said the exact opposite of what I posted.

As it says in the manual, swf sprites must have any animation in the main timeline and NOT embedded in movie clips (which can contain their own animation timelines inside them) as GMS will just display the first frame of these throughout the entire animation it will play from the main timeline.

You seem to be confusing this with swf frames being displayed inside the sprite editor, which is not what it's talking about.

For example, let's say you make an animation of a clock with its hands at 12:00, and each frame after that the hands move to simulate time passing - this is embedded into a movie clip on its own timeline.

You place this movie clip onto the main timeline and animate the clock x/y position in the main timeline, then export as swf.

When GMS plays this back the clock will move around the screen as the x/y position was animated on the main timeline of the swf file, but the clock will only ever display 12:00 because the animation of the hands moving is embedded inside the movie clip timeline - and only the first frame of these will ever be shown throughout the animation.

This is exactly what it says in the manual.

The sprite editor deals with pixel / raster / bitmap images (whatever you prefer to call them), so it doesn't make any sense that a vector sprite would have its individual frames displayed in the editor as they are completely different image formats.

TLDR: It only displaying 1 frame inside the sprite editor for swf sprites is the correct / intended behaviour and not a bug or something you are doing wrong.
...makes complete sense as you've described it.
Totally.
I'm very glad I was able to learn this all just now.

Thanks a LOT for your efforts in explaining!
 

rIKmAN

Member
are you talking about timelines in flash? that are translating to GMS?
Yes, the animation timeline in Flash or Animate etc, I'm not sure what other timeline you thought I was talking about?

All animation must be in the main timeline (in Flash/Animate etc) as per the manual, otherwise only the first frame of embedded movie clips will be shown throughout the length of the main timeline animation when played back in GMS. (Like in the clock example I gave above)

It's one of many reasons why using swf for anything more than art with simple shapes, colouring and animation has so many hurdles, workarounds and performance issues to be almost pointless.

I talk about it a little here, amongst other reasons why GMS isn't the go to tool for people wanting to make games using high res digital art.

Also, back to the original point - none of the above relates to showing only 1 frame in the sprite editor when you load a swf file - which it sounded like you were confusing in your previous post.
...makes complete sense as you've described it.
Totally.
I'm very glad I was able to learn this all just now.

Thanks a LOT for your efforts in explaining!
No problem, just bare in mind what you want to do with your graphics going forward (animation complexity, shape complexity, effects etc) and decide whether using swf will be suitable for them after considering all the caveats, issues and performance hits of using them with GMS, as opposed to a normal Flash/Animate environment where they are created.

I mean you can create a lovely gradient or whatever in Flash/Animate, but load that into GMS and you're gonna have a bad time with texture swaps. I had ~50 from 20 64x64 sprites placed on an asset later.

Create an animation with movie clips to help manage a complex animation - great, but GMS ain't gonna playback half of it - for that you need a sprawling mess of everything all on the main timeline etc etc

Note I'm not saying these thing can't be worked around with some planning and a lot of extra work, and some projects and art styles will work great even with the drawbacks - as I said above, simple shapes, basic colours and none complex animations would be fine.

I'm saying that we shouldn't need to work around these issues.
It's nearly 2018 and we can't use a gradient?
 
Last edited:
A

Anomaly

Guest
hmm.. i dont use gradients ever in my art. i think it looks tacky. (nothing personal to your preference)...

most of my graphics i'm using as vectors are very simple black and white drawings.
also my gameplay requires alot of scaling so zoomed quality is paramount here.

i've done tests with test games using empty rooms no code anywhere.. and the results are fantastic with the vectors saving space.


they just need to fix it so you can see the frames of the swf.. OR just be able to import illustrator files as frames.... so that you don't have to keep flash open as reference to which frames are which when you're coding animation control... guess i could just make a printed out chart.... whuich reminds me..

i've just realized flash(animate) has an "export sprite sheet" function... pretty cool!... (doesn't export as vector tho so.. meh ..hahah.
 
Top