Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-23-2007, 11:36 AM   #1
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,815
Send a message via Skype™ to panel
Default Embeding SWF File in Flash?

Hi

Main.as
Code:
package {
    import flash.display.*;

    public class Main extends Sprite {
        [Embed(source='Test.swf')]
        private var Test:Class;

        public function Main() {            
            var test:Sprite=new Test();
            addChild(test);
        }
    }
}
This code works in Flex, but when I am trying to do run it in Flash I am reciving error.

TypeError: Error #1007: Instantiation attempted on a non-constructor.
at Main$iinit()


It seems that flash can't see SWF files embeded this way. Is there any way to emdeb SWF in flash clases? (besides library linkage)
panel is offline   Reply With Quote
Old 04-23-2007, 05:17 PM   #2
dr_zeus
Flash Adventurer
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,984
Default

Flash Authoring doesn't support the [Embed] metadata type.
__________________
Josh Tynjala | JOSHBLOG | Bowler Hat Games
dr_zeus is offline   Reply With Quote
Old 04-23-2007, 08:00 PM   #3
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

You would just import the SWF to your library.
Tink is offline   Reply With Quote
Old 04-24-2007, 08:41 AM   #4
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,815
Send a message via Skype™ to panel
Default

Thats what I was thinking, but I wanted to be sure. Thanks
panel is offline   Reply With Quote
Old 04-26-2007, 12:48 PM   #5
SmackMe
smackmyworld
 
Join Date: May 2005
Location: Timisoara, Romania
Posts: 44
Default

Flash IDE ignores meta-tags and you end up instanciating smth you don't have access to
SmackMe is offline   Reply With Quote
Old 03-25-2010, 04:37 PM   #6
Rocketboy
Senior Member
 
Join Date: Apr 2006
Location: Brooklyn
Posts: 107
Smile

Quote:
Originally Posted by dr_zeus View Post
Flash Authoring doesn't support the [Embed] metadata type.
Actually, Flash CS4 supports [Embed] code, using the Flex SDK. You need to set the library path to the Flex SDK in your publish settings for this to work.

Not sure if its possible with CS3 though.
__________________
-jack
www.jackkalish.com
Rocketboy is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a PDF file in Flash AudryLucy Projectors and CDs 20 12-30-2006 01:43 PM
Some Flash Video Converter Tools Compare terry117 Detention 7 05-18-2006 02:08 AM
how to retrieve time when flash file finishes execution??? gayatri Server-Side Scripting 6 02-10-2006 04:12 AM
Can I launch an applescript from a flash .swf file? JLF Projectors and CDs 10 01-17-2005 12:24 AM
Help regarding Flash , PHP , MySQL but Flash as a Projector File and No Browser Needs mahendrakalkura Server-Side Scripting 1 04-13-2002 02:32 PM


All times are GMT. The time now is 07:36 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2010 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.