Did you looked flexmojos FAQ? On Fri, Jul 15, 2011 at 10:24 AM, Jose Ignacio Hita Barraza < [email protected]> wrote:
> Hi guys, > > I have a problem in a project compiled with the Mojos, in a custom > preloader, this is my configuration: > > Flex Compiler version: 4.5.1.2132 but I have also tried with > 4.5.0.20967. > Flex Mojos version: 3.9 but I have also tried with 3.8 and some betas > of 4. > > This is the pom.xml I have: > > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:// > www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:// > maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>com.company.project</groupId> > <artifactId>Flex</artifactId> > <version>1.0.1.0</version> > <name>Flex</name> > <packaging>swf</packaging> > > <properties> > <project.build.sourceEncoding>ANSI_X3.4-1968</ > project.build.sourceEncoding> > </properties> > > <scm> > <connection>*****</connection> > <developerConnection>*****</developerConnection> > <url>*****</url> > </scm> > > <build> > <sourceDirectory>src</sourceDirectory> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-scm-plugin</artifactId> > <version>1.0-SNAPSHOT</version> > <configuration> > <username>maven</username> > <password>*****</password> > </configuration> > </plugin> > > <plugin> > <groupId>org.sonatype.flexmojos</groupId> > > <artifactId>flexmojos-maven-plugin</artifactId> > <version>3.9</version> > <extensions>true</extensions> > <configuration> > <sourceFile>Flex.mxml</sourceFile> > > <resourceBundlePath>${basedir}/locale/{locale}</ > resourceBundlePath> > <compiledLocales> > <locale>en_US</locale> > </compiledLocales> > <runtimeLocales> > <locale>en_US</locale> > </runtimeLocales> > <themes> > > <theme>${basedir}/libs/halo.swc</theme> > </themes> > </configuration> > <executions> > <execution> > <id>compile-swf</id> > <goals> > > <goal>compile-swf</goal> > </goals> > </execution> > <execution> > <id>wrapper</id> > <goals> > <goal>wrapper</goal> > </goals> > <configuration> > <parameters> > > <title>Flex</title> > > <bgcolor>#ffffff</bgcolor> > </parameters> > > <templateURI>folder:html-template</templateURI> > > <htmlName>Flex-${project.version}</htmlName> > </configuration> > </execution> > </executions> > <dependencies> > <dependency> > > <groupId>com.adobe.flex</groupId> > > <artifactId>compiler</artifactId> > > <version>4.5.1.21328</version> > <type>pom</type> > </dependency> > </dependencies> > </plugin> > > <plugin> > > <artifactId>maven-resources-plugin</artifactId> > <version>2.5</version> > <executions> > <execution> > <id>copy-resources</id> > <phase>compile</phase> > <goals> > > <goal>copy-resources</goal> > </goals> > <configuration> > > <outputDirectory>${basedir}/target/media/</outputDirectory> > <resources> > <resource> > > <directory>${basedir}/src/media</directory> > > <filtering>false</filtering> > </resource> > </resources> > </configuration> > </execution> > </executions> > </plugin> > </plugins> > </build> > > <dependencies> > <dependency> > <groupId>com.adobe.flex.framework</groupId> > <artifactId>flex-framework</artifactId> > <version>4.5.1.21328</version> > <type>pom</type> > </dependency> > </dependencies> > </project> > > And this is my problem: I have a custom preloader that is loading a > custom SWF in the preload. When I do a compilation using Flex Builder > everything is OK, but when I do a compilation using this pom.xml and > the Mojos, the FlexEvent.INIT_COMPLETE event is never dispatched by > the preloader. This is the code I have in the custom preloader: > > public class CustomPreloader extends SparkDownloadProgressBar > { > [Embed(source="media/swf/loading.swf")] > private static const LoadingMC:Class; > > private var loadingSprite:Sprite; > > public function CustomPreloader() > { > super(); > } > > // Define the event listeners for the preloader events. > override public function set preloader(preloader:Sprite):void > { > preloader.addEventListener(FlexEvent.INIT_COMPLETE, > myHandleInitEnd); > > loadingSprite=new LoadingMC(); > loadingSprite.x=(stageWidth - loadingSprite.width) / 2; > loadingSprite.y=(stageHeight - loadingSprite.height) / 2; > addChild(loadingSprite); > } > > // Event listeners for the FlexEvent.INIT_COMPLETE event. > private function myHandleInitEnd(event:Event):void > { > dispatchEvent(new Event(Event.COMPLETE)); > } > } > > The problem is that in a normal compilation with Flex Builder the > myHandleInitEnd function is called, but with a compilation using Maven > and the Mojos the myHandleInitEnd is never called and the custom > preloader is displayed forever. > > Is this a bug? Can you guys help me? > > Thanks a lot. > > -- > You received this message because you are subscribed to the Google > Groups "Flex Mojos" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/flex-mojos > > http://flexmojos.sonatype.org/ > -- You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos http://flexmojos.sonatype.org/
