00:00
00:00
Newgrounds Background Image Theme

NobeastcanDefeatme just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS3: Flex: SWF loader

252 Views | 0 Replies
New Topic Respond to this Topic

AS3: Flex: SWF loader 2024-02-10 12:54:14


AS3: Flex: SWF loader

----------------------

AS3: Main

----------------------

Note: this is intended for those who are already well versed in AS3 code


here is a tutorial on creating a SWF loader

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
        <![CDATA[
            [Embed(source = "example.swf")]//add the SWF file to the variable
            [Bindable]//makes it so that the variable can be used in elements
            private var swf:Class;//creating a variable that will contain a SWF file
        ]]>
    </fx:Script>

    <!-- creating a SWF loader -->
    <s:SWFLoader source="{swf}" width="400" height="300" />
</s:Application>

SWF files execute code, this also applies to the trace() function;


Summary

you learned how to load SWF files into MXML


That's all for now, thanks for your attention, this is made for AS3 Main: Tutorials and Resources