Generating HTML wrapper using ant script

本文介绍如何通过在Ant构建脚本中添加html-wrapper标签来为Flex项目生成HTML包装文件。文中详细解释了所需配置参数及其作用,包括SWF文件名、宽度、高度等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Further to my post of compiling flex projects using Ant script, in this post I am going to tell that how you can generate the html wrapper file for the swf that is compiled using Ant.

If you haven’t read that post I request you to read it by clicking here.

In order to generate the html wrapper through Ant, we need to add only one extra tag, that is the “html-wrapper” tag, within the target tag in the Ant script.

In this tag, we have to define few important things like the title of the application (also shown in the browser title), the SWF name,  the width and height of the swf object, and a few other things like the minimum version of flash player that is required to run the swf correctly.

in order to add this tag to the previous example, first we will declare a few more properties, following is what I added:

<property name="version.major" value="0" />
<property name="version.minor" value="9" />
<property name="version.revision" value="0" />
<property name="APP_TITLE" value="Sample Application" />
<property name="APP_WIDTH" value="100%" />
<property name="APP_HEIGHT" value="100%" />

Next is that we need to add the html-wrapper tag, note that this tag should be added within the existing target tag if you want to generate the swf and the html at the same time, else you can make a different target only for generating the wrapper.

Here is how my html-wrapper tag looks like:

<html-wrapper title="${APP_TITLE}" file="index.html"
            application="app" swf="Main" width="${APP_WIDTH}"
            height="${APP_HEIGHT}" version-major="${version.major}"
            version-minor="${version.minor}" version-revision="${version.revision}"
            template="express-installation"
            output="${DEPLOY_DIR}" />

Note that I am using the properties that I defined above within this tag as attributes. It is also important to note that the swf attribute contains the name of the swf without the extension(.swf). After adding this much to my already existing build.xml, following is how my entire build.xml looks like:

<project name="My App Builder" basedir=".">
    <taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/flexTasks.jar"/>
    <property name="FLEX_HOME" value="C:/Program Files/Adobe/Flex Builder 3/sdks/3.0.0"/>
    <property name="APP_ROOT" value="src"/>
    <property name="DEPLOY_DIR" value="D:/output"/>
    <property name="version.major" value="0" />
    <property name="version.minor" value="9" />
    <property name="version.revision" value="0" />
    <property name="APP_TITLE" value="Sample Application" />
    <property name="APP_WIDTH" value="100%" />
    <property name="APP_HEIGHT" value="100%" />
    <target name="main">
        <mxmlc file="${APP_ROOT}/Main.mxml"
            output="${DEPLOY_DIR}/Main.swf">
        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
        <source-path path-element="${FLEX_HOME}/frameworks"/>
        </mxmlc>
        <html-wrapper title="${APP_TITLE}" file="index.html"
            application="app" swf="Main" width="${APP_WIDTH}"
            height="${APP_HEIGHT}" version-major="${version.major}"
            version-minor="${version.minor}" version-revision="${version.revision}"
            template="express-installation"
            output="${DEPLOY_DIR}" />
    </target>
</project>

And that’s it, now this build.xml is ready to be run as an Ant build. To run it, right click and select – Run As – Ant build, and it will generate the following files in the output directory:

AC_OETags.js
index.html
Main.swf
playerProductInstall.swf

Launch index.html to run the application.

 

原文:http://flex.gunua.com/?p=112

CycleGAN是一种深度学习模型,可以用于生成逼真的手写中文字符。它使用两个生成器和两个判决器构建,其中一个生成器可以将真实的手写中文字符转化为印刷体中文字符,另一个生成器则可以将印刷体中文字符转化为手写中文字符。 该模型的训练过程中,使用了两个损失函数:对抗损失和循环一致性损失。对抗损失确保生成的手写中文字符与真实的手写字符在外观上足够相似,而循环一致性损失则确保生成器能够保持原始字符的语义信息。 具体的训练步骤如下: 1. 收集并准备一个手写中文字符数据集和一个印刷体中文字符数据集,两者应有一定的对应关系。 2. 使用一个生成器将手写中文字符转化为印刷体中文字符,并使用一个判决器来辨别生成的印刷体字符和真实的印刷体字符。 3. 使用对抗损失函数来优化生成器和判决器,使生成的印刷体字符和真实的印刷体字符难以区分。 4. 使用另一个生成器将印刷体中文字符转化为手写中文字符,并使用另一个判决器来辨别生成的手写字符和真实的手写字符。 5. 使用对抗损失函数优化第二个生成器和判决器,使生成的手写字符和真实的手写字符难以区分。 6. 使用循环一致性损失函数来保证生成器的输出与原始字符之间的一致性,避免信息丢失。 7. 重复以上步骤,直到模型收敛。 通过这种训练方式,CycleGAN能够生成逼真的手写中文字符,同时保持其原有语义信息和外观特征。它可以应用于文书处理、字体设计等领域,为用户提供更多样化的中文字符选择。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值