??xml version="1.0" encoding="utf-8" standalone="yes"?>黄色大片在线播放,欧美日韩国产一区二区三区地区 ,theporn国产在线精品http://www.aygfsteel.com/wangxinsh55/category/29206.htmlzh-cnFri, 25 Feb 2011 08:09:36 GMTFri, 25 Feb 2011 08:09:36 GMT60Spring BlazeDS Integration 的相x?/title><link>http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345125.html</link><dc:creator>SIMONE</dc:creator><author>SIMONE</author><pubDate>Fri, 25 Feb 2011 07:58:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345125.html</guid><wfw:comment>http://www.aygfsteel.com/wangxinsh55/comments/345125.html</wfw:comment><comments>http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345125.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangxinsh55/comments/commentRss/345125.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangxinsh55/services/trackbacks/345125.html</trackback:ping><description><![CDATA[http://blog.csdn.net/remote_roamer/archive/2010/06/12/5667504.aspx<br /> <br /> http://yifanxiang.blog.163.com/blog/static/5000083420106158206254/<br /> <br /> http://www.licream.net/flex_spring_hibernate.html<br /> <br /> http://aguu125.javaeye.com/blog/527970<br /> <br /> <br /> <br /> <img src ="http://www.aygfsteel.com/wangxinsh55/aggbug/345125.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangxinsh55/" target="_blank">SIMONE</a> 2011-02-25 15:58 <a href="http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345125.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Google appegine上部|BlazeDS和SpringE序Q一Q?/title><link>http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345124.html</link><dc:creator>SIMONE</dc:creator><author>SIMONE</author><pubDate>Fri, 25 Feb 2011 07:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345124.html</guid><wfw:comment>http://www.aygfsteel.com/wangxinsh55/comments/345124.html</wfw:comment><comments>http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345124.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangxinsh55/comments/commentRss/345124.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangxinsh55/services/trackbacks/345124.html</trackback:ping><description><![CDATA[http://blog.sharpplus.com/content/%E5%9C%A8google-appegine%E4%B8%8A%E9%83%A8%E7%BD%B2blazeds%E5%92%8Cspring%E7%A8%8B%E5%BA%8F<br /> <br /> <h1 class="title">在Google appegine上部|BlazeDS和SpringE序Q一Q?/h1> <span id="wmqeeuq" class="submitted">?hubdog ?星期一, 2009-05-18 00:31 发表</span> <div id="wmqeeuq" class="taxonomy"> <ul class="links inline"> <li id="wmqeeuq" class="taxonomy_term_34 first last"><a rel="tag" title="">Flex</a></li> </ul> </div> <p>作者:(x)陈省</p> <p>首先参考http://ria.dzone.com/articles/introduction-spring- blazeds?page=0,2q篇文章Q这里我们用Spring Blazeds Integration包来替代SpringFactory的解x案来实现Spring和BlazeDS的集?</p> <p>1.首先修改Flex Builder3默认创徏的web.xml文g?/p> <p>1.1删除默认的MessageBroker Servlet</p> <p><strike>    <!-- MessageBroker Servlet --><br />     <servlet><br />         <servlet-name>MessageBrokerServlet</servlet-name><br />         <display-name>MessageBrokerServlet</display-name><br />         <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class><br />         <init-param><br />             <param-name>services.configuration.file</param-name><br />             <param-value>/WEB-INF/flex/services-config.xml</param-value><br />        </init-param><br />         <load-on-startup>1</load-on-startup><br />     </servlet></strike></p> <p>换成Spring的DispatcherServlet<br />     <!-- MessageBroker Servlet --><br />     <servlet><br />         <servlet-name>MessageBrokerServlet</servlet-name><br />         <display-name>MessageBrokerServlet</display-name><br />         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><br />         <load-on-startup>1</load-on-startup><br />     </servlet></p> <p>注意QSpring加蝲MessageBrokerServlet的时候,?x)同时查找W(wng)EB-INF\MessageBrokerServlet- servlet.xml文gQ添加WEB-INF\MessageBrokerServlet-servlet.xml文gQ内Ҏ(gu)加蝲spring? xsd</p> <p><?xml version="1.0" encoding="UTF-8"?><br /> <beans xmlns="http://www.springframework.org/schema/beans"<br />     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />     xsi:schemaLocation="http://www.springframework.org/schema/beans <a title="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"></a></p> <p></beans></p> <p>删除默认的Flex Listener和上下文配置</p> <p><strike>    <context-param><br />         <param-name>flex.class.path</param-name><br />         <param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value><br />     </context-param></strike></p> <p>    <!-- Http Flex Session attribute and binding listener support --><br />     <listener><br />         <listener-class>flex.messaging.HttpFlexSession</listener-class><br />     </listener><br /> </p> <p>换成Spring的上下文和Spring用Filter</p> <p>    <context-param><br />         <param-name>contextConfigLocation</param-name><br />         <param-value><br />             /WEB-INF/config/web-application-config.xml<br />             /WEB-INF/config/web-application-security.xml<br />         </param-value><br />     </context-param><br />     <br />     <filter><br />         <filter-name>springSecurityFilterChain</filter-name><br />         <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class><br />     </filter></p> <p>    <filter-mapping><br />       <filter-name>springSecurityFilterChain</filter-name><br />       <url-pattern>/*</url-pattern><br />     </filter-mapping><br />     <br />     <listener><br />         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class><br />     </listener></p> <p>1.2集成Spring的安全认?/p> <p>可以从http://coenraets.org/blog/2009/05/new-test-drive-for-spring- blazeds-integration-rc1/下蝲Spring Blazeds TestDrive集成包,查考里面的WEB-INF\config\web-application-security.xml文g<br />  </p> <p>1.3开放Spring Bean提供lFlex Remoting使用Q修改testdrive的WEB-INF\config\web-application-config.xml内容?/p> <p><?xml version="1.0" encoding="UTF-8"?><br /> <beans xmlns="http://www.springframework.org/schema/beans"<br />     xmlns:flex="http://www.springframework.org/schema/flex" xmlns:security="http://www.springframework.org/schema/security"<br />     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />     xmlns:context="http://www.springframework.org/schema/context"<br />     xsi:schemaLocation="<br />         <a title="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a><br />         <a title="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</a><br />         <a title="http://www.springframework.org/schema/flex">http://www.springframework.org/schema/flex</a> <br />         <a title="http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">http://www.springframework.org/schema/flex/spring-flex-1.0.xsd</a><br />         <a title="http://www.springframework.org/schema/security">http://www.springframework.org/schema/security</a><br />         <a title="http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">http://www.springframework.org/schema/security/spring-security-2.0.4.xsd</a><br />         <a title="http://www.springframework.org/schema/context">http://www.springframework.org/schema/context</a><br />         <a title="http://www.springframework.org/schema/context/spring-context-2.5.xsd">">http://www.springframework.org/schema/context/spring-context-2.5.xsd"></a></p> <p> <br />     <flex:message-broker/></p> <p>    <bean id="UserService" class="com.sharpplus.UserService" ><br />     </bean></p> <p>    <!-- Expose the productDAO bean for BlazeDS remoting --><br />     <flex:remoting-destination ref="UserService" /><br /> </beans><br />  </p> <p>UserService Bean只有一个GetUserҎ(gu)Q返回一个Hello Blazeds的字W串</p> <p>package com.sharpplus;</p> <p>public class UserService {<br />     public String getUser(){<br />         return "Hello Blazeds";<br />     }<br /> }</p> <p>创徏Flex客户端界面,调用我们的UserServiceQ显C字W串信息</p> <p><?xml version="1.0" encoding="utf-8"?><br /> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><br />     <mx:Script><br />         <![CDATA[<br />             import mx.rpc.events.ResultEvent;<br />             import mx.controls.Alert;<br />             <br />             private function onClick():void{<br />                 ro.getUser.addEventListener(ResultEvent.RESULT, onResult);<br />                 ro.getUser();<br />             }<br />             <br />             private function onResult(event:ResultEvent):void{<br />                 var s:String=event.result as String;<br />                 Alert.show(s);<br />             }<br />         ]]><br />     </mx:Script><br />     <mx:Button x="257" y="193" label="Hello BlazeDS"  click="onClick()"/><br />     <mx:RemoteObject id="ro" destination="UserService"><br />         <br />     </mx:RemoteObject><br />     <br /> </mx:Application><br />  </p> <p>JDBC for Google appengine</p> <p><a title="http://www.jiql.org/">http://www.jiql.org/</a></p> <br /> <br /> <img src ="http://www.aygfsteel.com/wangxinsh55/aggbug/345124.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangxinsh55/" target="_blank">SIMONE</a> 2011-02-25 15:56 <a href="http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345124.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Flex学习(fn)之五http://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345123.htmlSIMONESIMONEFri, 25 Feb 2011 07:55:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345123.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/345123.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2011/02/25/345123.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/345123.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/345123.htmlFlex学习(fn)之五 本文主要学习(fn)Flex跟spring如何集成。参考文档是 Spring BlazeDS Integration Reference Guide。spring已经提供了与flex的集成的支持Q主要的jar包下载地址Qhttp://www.springsource.com /download/community?project=Spring%20BlazeDS%20Integration

flex与spring集成的核心思想是让spring来管?MessageBroker。如何集成?可以ȝZ步?
1、首先,修改 web.xml文gQ将之前配置?MessageBrokerServlet  LҎ(gu)spring的,

<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/web-application-config.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>

2Q新建文?web-application-config.xml

<?xml version="1.0" encoding="GB2312" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/flex
           http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">

<!-- Bootstraps and exposes the BlazeDS MessageBroker simplest form -->
<flex:message-broker id="_messageBroker"
services-config-path="/WEB-INF/flex/services-config.xml">
<flex:mapping pattern="/messagebroker/*" />
<flex:exception-translator ref="myExceptionTranslator" />
</flex:message-broker>
       
         <!--
          上面配置是一U简单配|,另外一U更单配|ؓ(f)Q?
           <flex:message-broker/> 
         
           q有一U配|ؓ(f)Q?
           <bean id="mySpringManagedMessageBroker"
class="org.springframework.flex.core.MessageBrokerFactoryBean">
<property name="servicesConfigPath"
value="classpath*:flex/services-config.xml" />
            </bean>
          -->

<!-- Maps request paths at /* to the BlazeDS MessageBroker -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/*=_messageBroker
        </value>
</property>
</bean>

        <!-- 下面q个Adapterg不用配置Q因为我注释后照样可以?-->
<!--
Dispatches requests mapped to a MessageBroker <bean
class="org.springframework.flex.servlet.MessageBrokerHandlerAdapter"
/>
-->

</beans>

3Q写remoting-config.xml 文gQ?
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
    class="flex.messaging.services.RemotingService">

    <adapters>
        <adapter-definition id="java-object"
            class="flex.messaging.services.remoting.adapters.JavaAdapter"
            default="true"/>
    </adapters>

    <default-channels>
        <channel ref="my-amf"/>
    </default-channels>
   
</service>   
   
到目前ؓ(f)止,flex已经跟spring集成C起了?
4、将spring的bean导出为flex的Destination。我们要在web-application-config.xml文g中增加?
有三U方式:(x)
W一U:(x)
         <bean id="productService" class="flex.samples.product.ProductServiceImpl" />
          <flex:remoting-destination ref="productService" />
W二U:(x)
        <bean id="productService" class="flex.samples.product.ProductServiceImpl" >
          <flex:remoting-destination />
        </bean>
W三U:(x)
        <bean id="product" class="org.springframework.flex.remoting.RemotingDestinationExporter">
    <property name="messageBroker" ref="_messageBroker"/>
    <property name="service" ref="productService"/>
    <property name="serviceId" value="productService"/>
    <property name="includeMethods" value="read, update"/>
    <property name="excludeMethods" value="create, delete"/>
    <property name="channels" value="my-amf, my-secure-amf"/>
</bean>


附g是一个例子工E,没有提供jarQ工E中所需要的jar
backport-util-concurrent.jar
cfgatewayadapter.jar
cglib-nodep-2.1_3.jar
commons-codec-1.3.jar
commons-httpclient-3.0.1.jar
commons-logging.jar
concurrent.jar
flex-messaging-common.jar
flex-messaging-core.jar
flex-messaging-opt.jar
flex-messaging-proxy.jar
flex-messaging-remoting.jar
jackson-lgpl-0.9.5.jar
org.springframework.flex-1.0.0.RC1.jar
spring2.5.6.jar
spring-webmvc.jar
xalan.jar



SIMONE 2011-02-25 15:55 发表评论
]]>
flex3 load flashpaper使用LocalConnection和flash通讯http://www.aygfsteel.com/wangxinsh55/archive/2010/04/06/317553.htmlSIMONESIMONETue, 06 Apr 2010 06:04:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/06/317553.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/317553.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/06/317553.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317553.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/317553.html
国外有高手已l实CIE览器内加蝲flashpaper,好像是这吧: http://www.darronschall.com/weblog/2006/11/how-to-load-flashpaper- documents-in-flex-2.cfm q里在他的基础上改成利用LocalConnection来通讯,以便更好的处理来回的操作. flex load flashpaper也离不开flash,q个例子其实是用flash做一个空?比如命名FPload.swfq个壛_是用来加? flashpapaer?里面实现了对flashpaper的大设|?~略?|讄{等,注意q个fpload.swf是flash8?? flex中加载就得利用LocalConnection(如果不明白的得自己去惛_法了解了)或者例子中的ExternalInterface? fpload.swf通讯,去设|尺?大小,面{等 首先看flex3里面如何来加载flashpaper //com.magReader.FlashPaperLoader.as


package com.magReader
{

    
import flash.events.Event;
    
import flash.events.StatusEvent;
    
import flash.net.LocalConnection;
//import flash.system.System;

    
import mx.controls.SWFLoader;

    
/**
     * UIComponent designed specifically to load FlashPaper documents
     * and size them correctly in the available area.
     
*/
    
public class FlashPaperLoader extends SWFLoader
    {

        
/**
         * The id of the FlashPaperLoader.swf proxy that will be used
         * for communication pyurposes.
         
*/
        
public static const FLASH_PAPER_LOADED    : String = "flashPaperLoaded";
        
public static const FLASH_CONNERROR        : String = "flashConnError";
        
private var sendFlashConn:LocalConnection;
        
private var recieveFlashConn:LocalConnection;
        
/**
         * The name of the application that is loading in the FlashPaperLoader.swf
         * file.  This name must correspond to the "id" attribute in the object tag
         * and the "name" attribute in the embed tag when the Flex client is embedded
         * into the html page.
         
*/

        
/**
         * Constructor
         
*/
        
public function FlashPaperLoader()
        {
            
//source = "app-storage:/data/fpHolder.swf";
            sendFlashConn=new LocalConnection();
            recieveFlashConn 
= new LocalConnection();
            recieveFlashConn.client
=this;
            sendFlashConn.addEventListener(StatusEvent.STATUS, onStatus);
            sendFlashConn.allowDomain(
"*");
            recieveFlashConn.allowDomain(
"*");
            sendConn();
        }
        
public function sendConn():void
        {
            
try
            {
                recieveFlashConn.connect(
"_flexloader");
            } 
catch (error:ArgumentError) {
                trace(
"Can't connectthe connection name is already being used by another SWF");
                onConnError();
                
return;
            }
        }

        
private function onStatus(result:StatusEvent) :void{

            trace (result.level 
== "error"?"Operation failed":"Operation succeeded");

        }
        
//q接源出?/span>
        private function onConnError():void
        {
            
//errUnload();

            var e:Event
=new Event(FlashPaperLoader.FLASH_CONNERROR);
            dispatchEvent( e );
        }

        
// =================================================================
        
//  Expose methods that are proxied from FlashPaperLoader.swf - Call
        
//  JavaScript methods that the FlashPaperLoader.swf file picks up
        
//  and passes to the loaded FlashPaper document.
        
// =================================================================

        
public function setSize( width:Number, height:Number ):void
        {
            trace(
"=========setPaperSize=============");
            sendFlashConn.send(
"_flashpaperloader","setPaperSize",width,height);
        }
        
/**
         * 文档加蝲成功提示
         * 
*/
        
public function fpLoaded():void
        {
            trace(
"reveice fpLoaded message!! this.width = " + this.width + " this.height" + this.height);
            
//setSize(parent.width,parent.height);
            var e:Event=new Event(FlashPaperLoader.FLASH_PAPER_LOADED);
            dispatchEvent( e );
            
//this.visible=true;
        }
        
/**
         * 讄~放
         * 
*/
        
public function setZoom(value:Object):void
        {
            
if (this.visible)
            {
                sendFlashConn.send(
"_flashpaperloader","setCurrentZoom",value);
            }
        }

//    override protected function updateDisplayList( unscaledWidth:Number,
//                                                   unscaledHeight:Number ):void
//    {
//        if ( contentHolder )
//        {
//            // Adjust values so the FlashPaper document is displayed correctly
//            contentHolder.scaleX = 1.0;
//            contentHolder.scaleY = 1.0;
//            contentHolder.x = 0;
//            contentHolder.y = 0;
//    
//            contentHolder.scrollRect = new Rectangle( 0, 0, unscaledWidth, unscaledHeight );
//    
//            // When the content has loaded, call the setSize method so that the
//            // FlashPaper document sizes right in the available area
//            if ( Loader( contentHolder ).content )
//            {
//                setSize( unscaledWidth, unscaledHeight );
//                //this.setFocus();
//            }
//        }
//    }

        
//卸蝲此swf
        public function unload():void
        {
            
if(sendFlashConn != null
            {
                sendFlashConn.send(
"_flashpaperloader","unload");
                sendFlashConn 
= null;
            }
            
try
            {
                
if(recieveFlashConn != null
                {
                    recieveFlashConn.close();
                    recieveFlashConn 
= null;
                }
            }
catch(e:ArgumentError)
            {
                trace(e.toString());
                recieveFlashConn 
= null;
            }

            unloadAndStop(
true);
            
//System.gc();
        }
        
public function errUnload():void
        {
            
if(sendFlashConn != null
            {
                sendFlashConn.send(
"_flashpaperloader","unload");
                sendFlashConn 
= null;
            }
            
if(recieveFlashConn != null) recieveFlashConn = null;
            unloadAndStop(
true);
            
//System.gc();
        }

    } 
// end class
// end package




SIMONE 2010-04-06 14:04 发表评论
]]>
flex 加蝲flashpaperhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/06/317552.htmlSIMONESIMONETue, 06 Apr 2010 06:02:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/06/317552.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/317552.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/06/317552.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317552.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/317552.html
//d用loadFp.mxml 

<!--l version="1.0" encoding="utf-8-->

    
        
<!--[CDATA[
            
import com.magReader.FlashPaperLoader;
            
//flashpaper加蝲?/span>
            private var magReader:FlashPaperLoader;

            
private function initType():void
            {
                var urlStr:String 
= "Fpl.swf?url=template.swf";
                magReader 
= new FlashPaperLoader();
                magReader.source 
= urlStr;
                magReader.visible 
= false;
                magContainer.addChild(magReader);
                
//loadingBar.visible = true;
                magReader.addEventListener(FlashPaperLoader.FLASH_PAPER_LOADED,fpLoaded);
            }
            
//flashpaper已经加蝲完成
            private function fpLoaded(evt:Event):void
            {
                
//trace("magContainer width = " + magContainer.width + " magContainer height = " + magContainer.height);
                magReader.setSize(magContainer.width,magContainer.height);
                magReader.visible 
= true;
                
//loadingBar.visible = false;
                
//Lq度?br />                 //magContainer.removeChild(loadingBar);
                
//删除事g侦听
                magReader.removeEventListener(FlashPaperLoader.FLASH_PAPER_LOADED,fpLoaded);
            }
            
/**
             *
             * 改变容器昄大小
             * 
*/
            
public function changSize():void
            {
                
if(magReader != null)
                {
                    magReader.setSize(magContainer.width,magContainer.height);
                }
            }
        ]]
-->
    

    

    


//flash cs3代码,生成所需要的fpl.swf

import flash.display.Stage;
Stage.align 
= "LT"
//Stage.scaleMode = "showAll"; 
var url = "template.swf";
var fp;
//localConnection通讯接口
var caller:LocalConnection = new LocalConnection();
var sender:LocalConnection 
= new LocalConnection();
caller.connect(
"_flashpaperloader");
caller.allowDomain(
"*");
sender.allowDomain(
"*");
Security.allowDomain(
"*");
//讄面
//caller.setPage = function(n:Number)
//{
        
//fp.setCurrentPage(n);
//}

//讄大小
caller.setPaperSize = function(w:Number,h:Number)
{
        trace(
"fpLoader width=" + w + " height =" + h) ;
        fp.setSize(w,h);
}
//讄~放
//caller.setCurrentZoom = function(zoom:Object)
//{
        
//fp.setCurrentZoom(zoom);
        
//sendCurrentZoom();
//}
//讄下一?br /> //caller.nextPage = function()
//{
        
//var p:Number = fp.getCurrentPage();
        
//if(p + 1 <= fp.getNumberOfPages())
                
//fp.setCurrentPage(p + 1);
//}

//讄上一?br /> //caller.prePage = function()
//{
        
//var p:Number = fp.getCurrentPage();
        
//if(p - 1 > 0)
                
//fp.setCurrentPage(p - 1);
//}


//卸蝲
caller.unload = function()
{
        caller.close();        
        caller 
= null;
        sender 
= null;
        fp.destroy();
        fp 
= null;
        unloadAndStop();
        paper.unloadMovie();
        paper 
= null;
}


// function: loadFlashPaper
// ------------------------
// Load FlashPaper document, size it, 
// Parameters:
//   path_s: Path of SWF to load
//  dest_mc: Movie clip to hold the imported SWF
//  width_i: New size of the dest MC
// height_i: New size of the dest MC
// loaded_o: (optional) Object to be notified that loading is complete
function loadFlashPaper(path_s, dest_mc, loaded_o) {
        var intervalID 
= 0;
        var loadFunc 
= function(){
                trace(
"加蝲开?img src="http://www.aygfsteel.com/Images/dot.gif" alt="" />.");
                dest_mc._visible 
= false;                
                fp 
= dest_mc.getIFlashPaper();
                
if (!fp) { 
                        
return
                } 
else if (!fp.setSize(0,0)){ 
                        trace(
"没有讄H口大小");
                        
return
                } 
else {
                        trace(
"flashPaper加蝲成功?/span>");
                        clearInterval(intervalID);                
                        
//var pages_i = fp.getNumberOfPages();
                        
//paper.toolbar_mc.brandClip_mc.swapDepths(1000); 
                
//paper.toolbar_mc.brandClip_mc.removeMovieClip(); 
                        
//ctrlHolder_mc.swapDepths(_root.control_mc);
                        dest_mc._visible = true;                        // Now show the document
                        
//_root.control_mc._visible = true;        // Now show the controller
                        loaded_o.onLoaded(fp);
                }
        }
        intervalID 
= setInterval(loadFunc, 100);
        dest_mc.loadMovie(path_s);
}


// function: onLoaded()
// ------------------------
// Called once loading is complete
// Parameters:
//   fp: FlashPaper interface (returned by getIFlashPaper())
function onLoaded() {
        
// We can now call the FlashPaper API functions.
        
// Remove the standard user interface features:
        
//fp.showUIElement("PrevNext", false);
        fp.showUIElement("Print"false);
        
//fp.showUIElement("Find", false);
        
//fp.showUIElement("Tool", false);
        
//fp.showUIElement("Pop", false);
        
//fp.showUIElement("Zoom", false);
        
//fp.showUIElement("Page", false);
        
//fp.showUIElement("Overflow", false);
        
//fp.enableScrolling(false);
        
// Some additional API features (here commented out):
        
        fp.setCurrentZoom(
100);
        
//sendCurrentZoom();
        sender.send("_flexloader","fpLoaded");
}

// Hide the navigation controller until after the document is loaded:
//_root.control_mc._visible = false;  

// Create movie clip to hold the document:
var paper = this.createEmptyMovieClip("paper",100);
// Create movie clip to exchange the depth with the navigation controller clip:
//var ctrlHolder_mc = this.createEmptyMovieClip("ctrlHolder",200);

// Position the document clip on the stage:
paper._x = 0;
paper._y 
= 0;

// Load the FlashPaper document:
loadFlashPaper(url, paper, this);



SIMONE 2010-04-06 14:02 发表评论
]]>
仿豆丁flashpaper |页flash文档播放调用文档资料攉http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317423.htmlSIMONESIMONESat, 03 Apr 2010 15:46:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317423.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/317423.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317423.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317423.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/317423.html

配置要求:
1、服务器必须是windowspȝ
因ؓ(f)本插件必能doc、xls、docx、ppt、txt、pdf{等文档打开才可以,因ؓ(f)q些文档只支持windowspȝQ所有必L务器? windowspȝQ而且必须安装office和pdf阅读器?br /> 2、php必须支持exe函数调用Q因为首先要文档打开然后打印成flash格式Q?br /> 3、服务器必须支持虚拟打印功能
4、服务内存需要够大Q因为打印的时候要占用原有的内存(最低ؓ(f)2-4GQ;

满上述服务器配|条?才能支持在线文档插g。豆丁网几乎和上q配|一栗?/p>

q里为啥要征求大家意见:(x)
1、一斚w目前本插件在本服务器上测试OKQ因Z只是在编辑器上添加一个调用按钮,未与论坛程序完全整合,也就是说他的原理为,在编辑器上添加一个在 U文档按钮,然后跛_一个单文g上传pȝQ上传完成后Q自动调用打印程序,打印完成后将flash的地址通过媒体标签的Ş式传递到输入框,~辑帖子完成? xC文档flash
2、由于上q原理,如果真正的想和论坛程序深度整合的话,必须重写代码Q与论坛的附件上传整合到一P
3、由于服务器配置的局限性,可能需求的不多Q所以,惛_求大家意?/p>


有谁知道FlashPaper?word to htm有问题要h高手?
http://bbs.blueidea.com/thread-2781866-1-1.html
我有一些DOC文档要放在网上,但有Ҏ(gu)的格式,不能直接转换成HTMLQ用FlashPaper转换成SWF后,׃有Macromedia的LOGO ?qing)打华ͼ攑֤Q文本选择{一些工P不能很好的保护文档,因此Q想LLOGO?qing)打华ͼ攑֤Q文本选择{工P也知道FlashPaper的控制函敎ͼ? ׃可实在太菜Q也不知道怎么用,请DX多指教?br /> 另,有没有好的办法,SWF嵌入HTML后,通过~辑HTML来调用FlashPaper的控制函数来实现打印Q放大,文本选择{按钮的打开和关闭?
万分感谢?/p>

现在我用的是FlashPaper2.0Q有一个插件可以控Ӟ但是是不知道怎么用?br /> FlashPaper2.0:http://www.onlinedown.net/soft/35842.htm
插gQ?a >http://www.digitalflipbook.com/a ... ashpaper_comp_4.php
请高手回{,在此谢过?/p>

q里有一文章好像也能实玎ͼ?,但我q是没有弄明白,有谁能译一下就好了
http://www.adobe.com/devnet/flas ... mport_flpaper2.html

基本能实现控制按的打开和关闭了Q引?a >http://www.adobe.com/devnet/flas ... mport_flpaper2.html上面的方面。但是新的问题出来了Q由于只是生成一个新的SWFQ引用以前的SWFQ新的SWF不能单独q行Q如? 单独q行只能是一个空白文档。所以,有没有好的办法能直接对原始的SWFq行控制Q或者能否实现新生成的新的SWF中本w就包含原始的SWFQ而不仅仅 是引用,有没有办法实玎ͼ请DX们指教?br /> 举个例子Q?br /> 我有一个原始的用FLASFHPAPER生成的SWFQFLASHPAPER.swf,?a >http://www.adobe.com/devnet/flas ... mport_flpaper2.html的方法处理后Q去掉打华ͼ文本选择{按钮后Q生成一个新的SWF文gQFLASHPAPER-1.swfQ但新生 成的文g很小Q没有包含原始的FLASHPAPER.swfQ而仅仅只是引用。因此新生成的FLASHPAPER-1.swf不能独立q行Q必L FLASHPAPER.swf和FLASHPAPER-1.swf在一h才能q行FLASHPAPER-1.swf。现在的问题是怎么实现新生成的 FLASHPAPER-1.swf能独立的q行Q就是说新生产的FLASHPAPER-1.swf文档要包含原始的FLASHPAPER.swfQ而不? 仅是引用?br /> 求助各位DX了?/p>

q个问题已经d解决Q现在可以对SWFq行修改Q就是对FLASHPAPER的默认{换模板进行修改,然后控制打印Q文本复制等功能。对SWFq? 行反~译Q处理后解决?br /> 现在用FLASHPAPER处理出来的DOC文档Q不再会(x)有打华ͼ文本复制Q等功能Q只可看Q只可浏览。利用在|页中的止保存、禁止打印、禁止右键等? 码,较好的实C文档的保护?/p>

FlashPaper修改很容?我这里都有现成修改好?去logo dh,部分工具屏蔽{模?需要的站内PM

asp.net 调用 FlashPaper如何实现 有权限问题吗
http://topic.csdn.net/u/20081015/12/ef971788-d3e1-45e2-95a4-03565c917f05.html

ASP 调用 flashpaper p|
1、CMD里执?I:\I:\FlashPaper\FlashPrinter.exe I:\1.doc -o I:\1.swf 。I盘根目录下成功生?.swf
期间q程出现?winword.exe、FlashPrinter.exe 、还有一个macromedia的lisenceq程。用户名为ADMINISTRATOR。命令执行完Q均自动关闭?/p>

2、而ASP里执?WshShell.Run("I:\I:\FlashPaper\FlashPrinter.exe I:\1.doc -o I:\1.swf " ,0,true) |页开始出现反应慢。查看进E只有FlashPrinter.exe和macromedia的lisenceq程Q用户名均ؓ(f)iwamQ,未见 winword.exeq程。也没有文g生成?/p>

3、用另一ƾ{换工具pdf2swfQ通过ASPQ生成目标文件成功?/p>

4、怀疑ASP讉K时IWAN用户权限不够Q于是采用CPAU账户替换工具Q把IWAN替换成ADMINISTRATOR? FlashPrinter.exe和macromedia的lisenceq程出现Q且用户名均为ADMINISTRATORQ但IE报错“应用E序初始 化错?#8221;?/p>

5、期间尝试无数次办法Q把IWAN、IUSR加入理l;虚拟打印机加入IWAN、IUSR所有权限,修改l策略等{等...均失败?/p>

请高手解?......
问题补充QWshShell.Run("I:\FlashPaper\FlashPrinter.exe I:\1.doc -o I:\1.swf " ,0,true),刚才写错了?/p>

另外W四条时Q没有文件生成?/p>


命o(h)行调用FlashPaper Command Line Conversion
FlashPrinter.exe 2008q数据业务中心ITpȝ现状以及(qing)规划汇报080508.ppt -o 200808.swf

Unable to use sample code in php of sdk folder
http://print2flash.com/forum/viewtopic.php?f=4&t=58

Unable to use sample code in php of sdk folder
by jai on Fri Feb 29, 2008 12:39 am

when I use the sample code index.php on my server, then i get an error "Error writing file /hsphere/local/home/akashnig/clickmydocs.com/PHP/uploadedfiles\investm.rtf".

how can I use this sample code in my project on server to convert files. ???

I want to use print2flash in my project, please provide the code for this.............

If any help regarding this....please provide.jai

Posts: 1
Joined: Wed Feb 27, 2008 6:19 am Top
--------------------------------------------------------------------------------

Re: Unable to use sample code in php of sdk folder
by staff on Wed Mar 05, 2008 4:21 am

You need to grant Read and Write permissions to the uploadedfiles and convertedfiles folders for the user under which your web server runs (for IIS it is usually IUSR_xxx) and for the user which credentials you specified in the Print2Flash Service Configuration window.

No, command line does not support URLs. The solution may be writing a program for downloading and saving a page to disk, and then you can convert that page to Flash using Print2Flash command line.


Command Line failed in ASP
http://print2flash.com/forum/viewtopic.php?f=4&t=86

http://www.lynchconsulting.com.au/blog/index.cfm/2007/2/22/Batch-Convert-PDF-files-to-Flash-Paper

asp如何在服务器端调用winzip命o(h)行对上传的多个文件打?-asp~程技?br /> http://www.fansart.com/cweb/2006516174722.asp

写了2个小时的东东想了两天QPHP上传文gc?
http://farflight.blog.sohu.com/53196006.html

js调用可执行?exe)文g
http://blog.sina.com.cn/s/blog_5ca9fdd80100bdh1.html

liujunpeng的个人空间_列表_PHPChina 开源社区门?- powered by ..
http://www.phpchina.com/html/23/6123_type_blog_view_track.html

FlashPapercd
http://yourpalmark.com/downloads/flash/components/FlashPaper_doc.html

FlashPaperlg中文说明

http://www.mediamacros.com/item/item-1006687373/

If it's any help this is the code from my site which opens a document (newsletter).

<p class="smallCtrdTxt">This is a Flash document. You can see some controls just above the document. The control just left of the double arrow will open a new window or tab for full size viewing.</p>
<div class="flashDoc"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0, 19,0" width="100%" height="100" title="August Newsletter">
<param name="movie" value="images/docs/newsletterAugust07.swf" />
<param name="quality" value="high" />
<embed src="images/docs/newsletterAugust07.swf" quality="high" pluginspage=" </object></div>

找h开?br /> http://forums.adobe.com/thread/170010?tstart=330

http://print2flash.com/

http://space.flash8.net/space/?376578/viewspace-308332.html

php exec FlashPrinter有问?br /> http://zhidao.baidu.com/question/58766588.html

CMD q行带参数的E序 WEB调用
http://zhidao.baidu.com/question/129685919.html?si=8


于老師教室a論?: 觀看文? FlashPaper 轉換的檔案,如何嵌入?
http://203.208.37.132/search?q=cache:JM280Bxa4moJ:yunol.stes.tc.edu.tw/phpBB2/viewtopic.php%3Fp%3D27422%26sid%3D19c50e3736c5d28bc26ff188850fed12+php+flashpaper+%E4%BB%A3%E7%A0%81&cd=30&hl=zh-CN&ct=clnk&gl=cn&st_usg=ALhdy2_zM4XAz6LykBkw9PqDMznZSy_DYA

如何lFlash Paper生成的SWF文gd一个弹出窗口按? 看这?/p>

直接在URL后面加参?
http://www.dengjie.com/temp/tiger_book.swf?POPUP_ENABLED=true

PHP code
$exstr = "D:\\FlashPaper\\FlashPrinter.exe D:\\11.doc -o D:\\output1.swf";
exec($exstr);


在Flash中用FlashPaper API
http://www.happycampus.cn/docs/959266665903@hc09/154235/

.語法如下Q?
代碼:
<embed height="993" width="700" quality="high" type="application/x-shockwave-flash" src="

SIMONE 2010-04-03 23:46 发表评论
]]>
IFlashPaperhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317422.htmlSIMONESIMONESat, 03 Apr 2010 15:44:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317422.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/317422.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317422.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317422.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/317422.html
http://www.adobe.com/support/documentation/en/flashpaper/2/flashpaper_api/flashpaper_api3.html
interface FlashPaper.IFlashPaper
{
function addListener(listener:Object):Void;
function removeListener(listener:Object):Void;
function getViewerType():String;
function getViewerVersion():Number;
function getCurrentPage():Number;
function setCurrentPage(pageNumber:Number):Void;
function getNumberOfPages():Number;
function getLoadedPages():Number;
function showUIElement(part:String, flag:Boolean):Void;
function printTheDocument():Boolean;
function setCurrentZoom(percent:Object):Void;
function getCurrentZoom():Number;
function setSize(w:Number, h:Number):Boolean;
function goToLinkTarget(linktarget:String, window:Object):Void;
function enableScrolling(flag:Boolean):Boolean
function getCurrentTool():String;
function setCurrentTool(tool:String):Boolean;
function getTextSelectionRange():FlashPaper.SelectionRange;
function setTextSelectionRange(sel:FlashPaper.SelectionRange,
skipBroadcast:Boolean):Void;
function getSelectedText():String;
function getSidebarWidth():Number;
function setSidebarWidth(w:Number):Void;
function getFindText():String;
function setFindText(s:String):Void;
function findNext():Boolean;
function getVisibleArea():Object;
function setVisibleArea(area:Object, skipBroadcast:Boolean):Void;
};




SIMONE 2010-04-03 23:44 发表评论
]]>
How to load FlashPaper Documents in Flex 2http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317420.htmlSIMONESIMONESat, 03 Apr 2010 15:42:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317420.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/317420.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317420.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317420.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/317420.html

If you've ever tried to load a FlashPaper document in Flex 2, then you know it's not as straightforward as it was with Flex 1.5.

Sure, you can just use an <mx:SWFLoader /> tag. But, if you've tried this, you know it's pretty limited. You can't talk to the FlashPaper document, and the loaded document gets stuck at a fixed size or scales incorrectly when resized. If you try fiddling with the various scaleContent and maintainAspectRatio settings, you'll quickly get frustrated trying to achieve the perfect resize behavior.

I've run into this problem in the Flex 2 application I'm currently building. We're using ColdFusion to generate dynamic reports via the <cfreport> tag, capturing the report output as FlashPaper, and then loading the report output .swf directly into the Flex 2 application. I'm happy to say that I've solved the resize and communication issues, and I've been given permission to post these on my weblog from the client that I've written the code for.

You can download my Flex 2 FlashPaperLoader here. (.zip archive) - MIT License

There's a lot of interesting things going on the .zip file. In the archive you'll find the following files:

  • flash
    • FlashPaperLoader.fla
    • FlashPaperLoader_code.as
  • flex
    • com/darronschall/controls/FlashPaperLoader.as
    • FlashPaperLoaderExample.mxml

Note that the code is mostly complete but it is not a compile-ready working example. You will need a few tweaks get it working: You'll need to create a new Flex project named "FlashPaperLoaderExample" out of the code in the flex subdirectory, copy the flash/FlashPaperLoader.swf file to the Flex project's bin directory so it lives along side of the Flex 2 output .swf, change the "flashPaperURL" in the FlashPaperLoaderExample.mxml to point to a valid FlashPaper document... and then you should be good to go.

The example file contains an indeterminate progress bar that loads a FlashPaper document full screen. The progress bar goes away when the FlashPaper is fully loaded. Try resizing your browser window to see how the loaded FlashPaper document resizes to fill the available space.

The best way to understand what is going on is to just dive in and take a look at the code. Start in FlashPaperLoaderExample.mxml, then FlashPaperLoader.as, then look in FlashPaperLoader_code.as. Basically, the concept is this:

The FlashPaperLoader Flex control is used to load a Flash 8 ActionScript 2 FlashPaperLoader.swf file, generated from the FlashPaperLoader.fla file. The FlashPaperLoader.swf file is passed the URL of the FlashPaper document, as well as a unique identifier (fpProxyId) and the object/embed name of the Flex client (swfDomId) - "FlashPaperLoaderExample" in this case. The latter two parameters are necessary for the communication mechanism between Flex and FlashPaper. The loaded FlashPaperLoader.swf handles loading the FlashPaper document and fosters communication between Flex 2 and FlashPaper.

Communication is done through ExternalInterface. By leveraging JavaScript, the ActionScript 3 code running inside of AVM2 can communicate with the ActionScript 2 code running inside of AVM1. There is no way for the two different VMs to talk directly, so JavaScript acts as the middle man.

So, if the Flex client needs to resize the FlashPaper document, it calls a JavaScript method such as "APP.setSize82" where "82" is the fpProxyId unique identifier and "APP" is the object/embed id/name attribute of the Flex client embedded in the HTML page. The FlashPaperLoader.swf file registers a handler for the JavaScript method setSize82 with its own internal setSize method, so when the Flex client invokes the JavaScript method, the FlashPaperLoader.swf file picks it up. Then, in turn, the loader .swf just invokes the setSize method on the loaded FlashPaper document passing in the appropriate width and height. A similar process is used for going from FlashPaper to Flex 2.

The reason the fpProxyId is needed is for when the Flex client loads multiple FlashPaper documents. The Flex client needs to know that it's calling a method on the appropriate FlashPaper target, so the id is used to differentiate the different loaded loader .swf files.

I know it sounds a little confusing, but everything is explained inside of the source code.

There are a few improvements that can be made to this code. One of them is that I'm only exposing the "setSize" and "printTheDocument" methods from the IFlashPaper interface. Obviously, there are a lot more methods than that (but that was all I've needed so far). Additionally, it might be a little cleaner to use FlashInterface for the communication between AVM1 and AVM2, but I wrote my code some two months ago and didn't feel the need to change the basics of it since it's been working flawlessly for me. Also, you might want to have the FlashPaperLoader.swf proxy the percentage complete when loading a FlashPaper document so the Flex 2 client can update the loaded progress correctly.

I hope that helps! I know a few people have been asking about this, so hopefully my code will get things working for you as well. As I said, I've been using this technique for awhile nowâ ¦ Good luck!




SIMONE 2010-04-03 23:42 发表评论
]]>
flash控制FlashpaperQƈ全屏q播?/title><link>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317419.html</link><dc:creator>SIMONE</dc:creator><author>SIMONE</author><pubDate>Sat, 03 Apr 2010 15:39:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317419.html</guid><wfw:comment>http://www.aygfsteel.com/wangxinsh55/comments/317419.html</wfw:comment><comments>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317419.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317419.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangxinsh55/services/trackbacks/317419.html</trackback:ping><description><![CDATA[http://hi.baidu.com/gacmotor/blog/item/57577fd064814c339a502708.html<br /> <br /> <div class="wmqeeuq" id="blog_text" class="cnt"> <div id="wmqeeuq" class="cnt"> <p>Stage.align = "TL"; <br /> Stage.scaleMode = "noScale"; <br /> function hideBrand () { <br />     if (paper.gMainView.m_numPagesLoaded) { <br />         paper.toolbar_mc.brandClip_mc.swapDepths(1000); <br />         paper.toolbar_mc.brandClip_mc.removeMovieClip(); <br />    paper._x=0;<br />    paper_y=0;<br />    paper.setSize (Stage.width, Stage.height); <br />    clearInterval (hideBrandInterval); <br />     } <br /> } <br /> createEmptyMovieClip ("paper", 1); <br /> paper.loadMovie ("hdywsc.swf"); <br />    //止内容~放 <br /> fullscreen = new Object();//创徏c?br /> fullscreen.onResize = function() {//swf大小改变时触?br />    paper._x=0;<br />    paper_y=0;</p> <p>paper.setSize (Stage.width, Stage.height); <br /> //和左对?<br /> //paper._x = Stage.width-300;//Ҏ(gu)Stage.width和Stage.height获得的舞台的宽和高来调整昄<br /> //paper._x=System.capabilities.screenResolutionX;<br /> //paper_y=System.capabilities.screenResolutionY;<br /> };<br /> Stage.addListener(fullscreen);<br /> hideBrandInterval = setInterval (hideBrand, 1);</p> </div> </div> <br /> <br /> <img src ="http://www.aygfsteel.com/wangxinsh55/aggbug/317419.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangxinsh55/" target="_blank">SIMONE</a> 2010-04-03 23:39 <a href="http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317419.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>隐藏flash paper上面Macromedia标志的方?/title><link>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317418.html</link><dc:creator>SIMONE</dc:creator><author>SIMONE</author><pubDate>Sat, 03 Apr 2010 15:38:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317418.html</guid><wfw:comment>http://www.aygfsteel.com/wangxinsh55/comments/317418.html</wfw:comment><comments>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317418.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317418.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangxinsh55/services/trackbacks/317418.html</trackback:ping><description><![CDATA[<div class="wmqeeuq" id="blog_text" class="cnt"> <p>http://hi.baidu.com/gacmotor/blog/item/09cb4b09975affda63d98608.html<br /> </p> <p>function hide_MMlogo_greentea () {<br /> if (paper.gMainView.m_numPagesLoaded) {<br /> paper.toolbar_mc.brandClip_mc.swapDepths(1000);<br /> paper.toolbar_mc.brandClip_mc.removeMovieClip();<br /> paper.setSize (640, 600);<br /> clearInterval (hideBrandInterval);<br /> }<br /> }</p> <p> </p> <p>hideBrandInterval = setInterval (hide_MMlogo_greentea, 1);</p> </div> <img src ="http://www.aygfsteel.com/wangxinsh55/aggbug/317418.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangxinsh55/" target="_blank">SIMONE</a> 2010-04-03 23:38 <a href="http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317418.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>FlashPaper API 说明http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317417.htmlSIMONESIMONESat, 03 Apr 2010 15:35:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317417.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/317417.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317417.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317417.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/317417.html
我们可以一?FlashPaper 文档插入?Flash?FLA 源文件中。当?FLA 文g导出?
SWF 文gӞFlashPaper SWF文g׃(x)嵌入到导出的SWF 文g中?
下面的代码显CZ一个普通的Flash FLA 文g是如何?loadFlashPaper() 函数?
入一?FlashPaper SWF 文档的?
function loadFlashPaper(
path_s, // path of SWF to load
dest_mc, // MC which we should replace with the SWF
width_i, // new size of the dest MC
height_i, // new size of the dest MC
loaded_o) // optional: object to be notified that loading is complete
{
var intervalID = 0;
var loadFunc = function()
{
dest_mc._visible = false;
var fp = dest_mc.getIFlashPaper();
if (!fp)
return;
if (fp.setSize(width_i, height_i) == false)
return;
dest_mc._visible = true;
clearInterval(intervalID);
loaded_o.on
Loaded(fp);
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
下面的代码显C已l嵌入一个FlashPaper SWF文档后如何?loadFlashPaper() ?
数?
function onLoaded(fp)
{
// loading is complete, so we can now adjust the current page, zoom, etc.
// go to page 50.
fp.setCurrentPage(50);
// change magnification to 33%
fp.setCurrentZoom(33);
}
loadFlashPaper("FlashPaper.swf", theDocMC, theDocMC._width, theDocMC._height, this);
其中 fp.setCurrentPage D讄?50Qfp.setCurrentZoom D讄?33Q当 FLA
文g被导出时Q嵌入的 FlashPaper SWF文g?33%的放大倍率在导出的 SWF 文g中出现?
Flash Paper 2 生成的SWF可以通过AS载入到Flashq中用APIq行控制,如下:
createEmptyMovieClip("fPaper", 0);
var my_mcl = new MovieClipLoader();
myListener = new Object();
my_mcl.addListener(myListener);
my_mcl.loadClip("FlashPaper.swf", fPaper);
myListener.onLoadInit = function (target_mc)
{
onEnterFrame = function()
{
fPaper.showZoomUI(false);
fPaper.showPrintUI(false);
fPaper.setCurrentZoom("width");
fPaper.setCurrentPage(2);
delete onEnterFrame;
}
}
Flash Paper 2 API:
FlashPaperlg- -完整的APi
2009q?2 ?4?星期?14:18
它可以蝲入由FlashPaper2.0生成的SWF文gQ?而且提供了一pd讄的函
敎ͼ实在是不可多得的好东西!现在推荐下!
下蝲包含lg说明Q英文)
lg说明Q英文)
下面是我译的部分组件说明(F(tun)lash Paperc)可用?
ActionScript 1.0; Flash Player 6
属性摘?
属?说明
documentPath:String FlashPaper文g的\?
borderThickness:Number Ҏ(gu)宽度.
borderColor:String Ҏ(gu)颜色.
UIElements:Object 外观元素的可见?
currentZoom:Object 默认~放比例.
width:Number FlashPaper文g的宽?
height:Number FlashPaper文g的高?
UIElements属性的囄
事g摘要
事g 说明
onLoadStart = function(target:FlashPaper, type:String) {} 当FlashPape
文g已开始下载文件时调用.
onLoadProgress = function(target:FlashPaper, type:String,
bytesLoaded:Number, bytesTotal:Number) {} 每当FlashPape文g写入盘?
调用.
onLoadComplete = function(target:FlashPaper, type:String) {} ?
FlashPape文g完全下蝲时调?
onLoadInit = function(target:FlashPaper, type:String) {} 当执?
FlashPape文gW一帧上的动作时调用.
onLoadError = function(target:FlashPaper, type:String,
errorCode:String) {} 当FlashPape文g未能加蝲时调?
onDisplay = function(target:FlashPaper, type:String) {} 当FlashPape
文g已经昄时调?
onUnload = function(target:FlashPaper, type:String) {} 当卸载FlashPape
文g时调?
onPageChanged = function(target:FlashPaper, type:String,
newPageNumber:Number) {} 当FlashPape文g页时调?
onZoomChanged = function(target:FlashPaper, type:String,
percent:Number) {} 当FlashPape文g~放时调?
onSelection = function(target:FlashPaper, type:String) {} 当FlashPape
文g的文字被选择时调?
onToolChanged = function(target:FlashPaper, type:String,
newTool:String) {} 当更换FlashPape文g?工具时调?
onEnableScrolling = function(target:FlashPaper, type:String,
enable:Boolean) {} 当FlashPape文g滚动时调?
onVisibleAreaChanged = function(target:FlashPaper, type:String) {} ?
FlashPape文g的哭件区域变化时调用.
Ҏ(gu)摘要
Ҏ(gu) 说明
load(path:String) : Void 载入一个FlashPape文g.
destroy() : Void 卸蝲FlashPape文g.
move(x:Number, y:Number) : Void UdFlashPapelg).
toString() : String q回lg的名U?
getIFlashPaper() : FlashPaper.IFlashPaper q回一个实现IFlashPaper接口
的对?
如果q个函数未定?那么载入的SWF文g不是一个FlashPaper 2.0文g.
如果q个函数存在,但是q回null或undefined,那么载入的SWF文g是一?
FlashPaper 2.0文g,但是q没有蝲入够的内容d现这个API;你必ȝ待蝲
入够的内容q且再次调用?
getViewerType() : String q回一个描q包?SWF文g的接口的cd的字W串.
q个Macromedia FlashPaper标准阅读器Lq回Macromedia FlashPaper
Default Viewer.
getViewerVersion() : Number q回一个标识这个文件接口版本代h?
q回的整C是连l的,但是q个整数昄阅读器最q的版本 ,而且可以昄?
错或增强的功?
比如FlashPaper 2.01q回 218.
getCurrentPage() : Number q回当前|(与工h昄的相?.W一|
1.
setCurrentPage(pageNumber:Number) : Void 讄当前|.需要保证此|?
昄?但不必调节羃?
getNumberOfPages() : Number q回文g总页?
注意: 也许不是所有的都是可昄? 屈就于连接速度.
getLoadedPages() : Number q回当前载入的页?可显C的).
q个数g定在0到getNumberOfPages()之间.
?
getLoadedPages() == getNumberOfPages()
?q个文g便完全蝲?
showUIElement(part:String, flag:Boolean) : Void 应藏或者显CFlashPaper
文g外观的部?区分大小?
"PrevNext" 前一和后一|钮的隐藏或显C?
注意: 如果q些按钮是隐藏的,当前|字框回失?但不?x)隐?
"Print" 打印按钮的隐藏或昄.
"Tool"所有工具选择按钮的隐藏或昄.
"Zoom" 所有所放控制按钮的隐藏或显C?
"Find"文字搜烦框的隐藏或显C?
"Pop" 在浏览器中打开文g按钮的隐藏或昄.
"Sidebar"Ҏ(gu) (昄文gҎ(gu))按钮的隐藏或昄.
注意: q个变量无论q个文g是否包括Ҏ(gu)i; 没有Ҏ(gu)的文件从不显C?
按钮.
"Page" 当前和总页数按钮的隐藏或显C?
"Overflow" 出菜单的隐藏或昄.
注意:q个菜单仅在工具条太狭窄而不能显C时;你不能用q个变量强制昄?
?
"ZoomKeys" q个参数不媄响外?他控制是否能用快捷键所放文?例如,
+, -, p, w).
"Brand" 品牌按钮的隐藏或昄.
"Close" 关闭按钮的隐藏或昄.
traceUIElements() : Void 输出UI Elements的可见?
printTheDocument() : Boolean 模仿用户单击{应按钮. 在调用函数前,文g?
d全蝲?
getCurrentZoom() : Number q回当前~放水^.
注意: ~放水^Lq回一个数值r;不会(x)q回面宽度.
setCurrentZoom(percent:Object) : Void 讄当前~放水^.你可以传入一?
数值指C所攄分比 (例如, 100表示100%)..你也可以传入一个字W串
"width"适合面宽度,或者传入字W串 "page"适合到页.
setSize(w:Number, h:Number) : Boolean 讄lg的显C排?单位是象?
如果成功讄则返回true,不成功则q回false.
goToLinkTarget(linktarget:String, window:Object) : Void 触发锚点或URL
q接h.
如果传入的字W串是锚点名U?foo,当前视图?x)移动到那个锚?window参数
?x)被忽?如果foo不是一个有效的锚点名称,则不?x)执行动?对于其它的字W?
??x)执行getURL(linktarget, window) (想了解更多的信息,误
ActionScript文档).
enableScrolling(flag:Boolean) : Boolean L用户滚动文g.当滚动被止
?
滚动条不可用,但是可见.
滚动按钮不可?
使用鼠标滚轮滚动不可?
getCurrentTool() : String q回当前zd的工?如果没有zd的工?则返?
I字W串.以下是现在支持的?
"" (没有工具)
"pan" (手Ş工具)
"select" (文字选择工具)
setCurrentTool(tool:String) : Boolean 讄zd工具.如果参数错误或者该
工具不可用则q回false.以下是现在支持的?
"" (没有工具)
"pan" (手Ş工具)
"select" (文字选择工具)
getTextSelectionRange() : FlashPaper.SelectionRange q回一个描q当前?
择文字的对象.如果没有选择文字,则返回null.
注意:与getVisibleArea()q回的对象不?q个函数Lq回一?
FlashPaper.SelectionRange,q是一个明定义的对象, 你可以检?分解或?
构造一个新的对?
setTextSelectionRange(sel:FlashPaper.SelectionRange,
skipBroadcast:Boolean) : Void 选择特定的文?你可以传入null,从而取?
选定所有的文字.无效的范?没有面)?x)被省?它允怽讑֮范围 ?C
个很大的?例如999999,从而选定所有文?.如果skipBroadcast是false (?
未定?, ?x)广播onVisibleAreaChanged(). 如果skipBroadcast是true, 则不
?x)广播onVisibleAreaChanged().
注意:与getVisibleArea()q回的对象不?q个函数Lq回一?
FlashPaper.SelectionRange,q是一个明定义的对象, 你可以检?分解或?
构造一个新的对?
getSelectedText() : String 以Unicode~码的字W串q回选择的文?如果?
有被选择的文??x)返回空字符?
getSidebarWidth() : Number q回其他按钮的宽?
没有Ҏ(gu)的文件会(x)q回0.
setSidebarWidth(w:Number) : Void 讄其他按钮的宽?
传入0从而完全隐藏其他按?
没有Ҏ(gu)的文件会(x)忽视调用.
getFindText() : String 以Unicode~码的字W串q回查找的文?
setFindText(s:String) : Void 讄文字查找框的文字.
q个函数不会(x)执行查找操作或改变当前选择.
findNext() : Boolean 查找文字查找框中输入的文?
从当前选择文字的后面开始查?
要从文档的开头查?请先调用setSelectionRange(null).
如果扑ֈ了文?调用getTextSelectionRange()q回详细的范?
getVisibleArea() : Object q回描述文档当前可见区域的对?q回的对象有
如下作用:
传入setVisibleArea().
q个可以用来在不同的计算Z观看同一文档,而且可以保持同步.
与先前getVisibleArea()q回的对象进行比?试可见区域是否改变.
q回的对象应该被认ؓ(f)是封闭的数据l构.不要试图分解q回的对?因ؓ(f)在将
来的版本中内容的格式可能不同.
q个对象唯一不变的方法是:
function equals(that:Object):Boolean;
我们可以用它比较两个可见区域是否相同.
setVisibleArea(area:Object, skipBroadcast:Boolean) : Void 调节当前可见
的页/~放/滚动从?匚wl定的区域对?
如果skipBroadcast是false (或未定义), ?x)广播onVisibleAreaChanged().
如果skipBroadcast是true, 则不?x)广播onVisibleAreaChanged().
传入的对象必L先前由getVisibleAreaq回的对?
不要试图创徏你自q对象,因ؓ(f)在将来的版本中内容的格式可能不同.


SIMONE 2010-04-03 23:35 发表评论
]]>
在web 上调用exe权限解决Ҏ(gu) ,关于FlashPaper2 命o(h)行FlashPrinterexe的调?/title><link>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317416.html</link><dc:creator>SIMONE</dc:creator><author>SIMONE</author><pubDate>Sat, 03 Apr 2010 15:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317416.html</guid><wfw:comment>http://www.aygfsteel.com/wangxinsh55/comments/317416.html</wfw:comment><comments>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317416.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317416.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangxinsh55/services/trackbacks/317416.html</trackback:ping><description><![CDATA[<p>http://hi.baidu.com/jiaxw/blog/item/93b619f38c5d805b342accf8.html<br /> </p> <p><br /> </p> <p>在此之前我已l找q很多国外的文章Q很多h都碰到类似的情况 <br /> 是通过asp.net 调用服务器上的FlashPrinter.exe E序,(q个E序可以通过虚拟打印机把所有可打印的文件{换成swf文g) <br /> 我这里是通过Processc调用的 <br /> CMD的命令式q样?<br /> xxx\\xxx\\FlashPrinter.exe "d:\\1.txt" -o "d\\1.swf" <br /> 我在服务器上直接输入上面命o(h)行正常运?<br /> 但是通过web 也就是Network Services用户l调用就没有正常输出文gQ?<br /> 我调试过可以正常调用FlashPrinter.exe q程,但就一直没有输出文?<br /> <br /> 我曾l从新安装新的window2003用于试 <br /> W一ơ我用了好几个小时去? <br /> 1.IIS权限 <br /> 2.用户l权?<br /> 3.本地{略 <br /> 4.打印机权?<br /> 我忘C是搞了那些东西,不知不觉可以通过asp.net 正常使用那个功能. <br /> 后来我ؓ(f)了再ơ测试,我把pȝq原了,l果我怎么在设|也不能正常调用那个功能?<br /> 在此之前已经讄q很多东西上面所说的是我不知道怎么栯|就可以q行?<br /> PS:我nҎ(gu)好几台机器,有些是正常的Q有些就是一直烦着..查看事g日志说是已经成功转送打印命令,但就是打印的字节Cؓ(f)0</p> <p>xpdf转换成swf文gQ就在asp.net后台代码中启动了flashpaperq程Q但同样的代码在winxp下,好用。但? win2003下,׃好用了。代码如下:(x) <br /> <br /> public static void ConvertPdfToSwf(HttpRequest reqeust, String styFileName, String[] dataFileNames, String outputFileFullName) <br /> { <br /> try <br /> { <br /> String flashPrinter = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "FlashPrinter.exe");//FlashPrinter.exe <br /> System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(flashPrinter); <br /> if (String.IsNullOrEmpty(outputFileFullName)) <br /> { <br /> return ; <br /> } <br /> Int32 intLastDot = outputFileFullName.LastIndexOf("."); <br /> //*********Temp Programming**************************************** <br /> Int32 intLast = outputFileFullName.LastIndexOf("\\"); <br /> String path = outputFileFullName.Substring(0, intLast); <br /> String tempFileName = path + "\\PdfToSwf20080923.pdf"; <br /> //***************************************************************** <br /> String swfFileName = String.Concat(path, "\\PdfToSwf20080923.swf"); <br /> startInfo.Arguments = String.Concat(tempFileName, " -o ", swfFileName); <br /> System.Diagnostics.Process process = new System.Diagnostics.Process(); <br /> process.StartInfo = startInfo; <br /> Boolean isStart = process.Start(); <br /> process.WaitForExit(); <br /> process.Close(); <br /> } <br /> catch(Exception ex) <br /> { <br /> throw ex; <br /> }</p> <img src ="http://www.aygfsteel.com/wangxinsh55/aggbug/317416.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangxinsh55/" target="_blank">SIMONE</a> 2010-04-03 23:25 <a href="http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317416.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>FlashPaper2.2在jsp?/title><link>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317415.html</link><dc:creator>SIMONE</dc:creator><author>SIMONE</author><pubDate>Sat, 03 Apr 2010 15:16:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317415.html</guid><wfw:comment>http://www.aygfsteel.com/wangxinsh55/comments/317415.html</wfw:comment><comments>http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317415.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangxinsh55/comments/commentRss/317415.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangxinsh55/services/trackbacks/317415.html</trackback:ping><description><![CDATA[http://yanghack.javaeye.com/blog/480516<br /> 最q用FlashPaper2.2与java 的做了个webE序, <br /> 功能是,用户上传的office文档PDF文档,上传后{换成swf在网上昄 <br /> DOS命o(h)很好执行 <br /> FlashPrinter.exe "C:\aa.DOC" -o "C:\aa.DOC.swf" <br /> java里就? <br /> Process process = Runtime.getRuntime().exec(cmd) <br /> 但是用process.waitFor();Ҏ(gu)造成锁死,不徏议? <br /> l过分析,可能是由于office版本q高 <br /> 用office2007,能正常{换doc,ppt,pptxq几? <br /> 如果在程序里,转换其他个比如docx,xls..造成锁死? <br /> 所以还是不让它转吧,试试office2003. <br /> pdf文g,׃装的是Adobe Reader 9, <br /> 服务器必L开一个Adobe Reader 9的空H口然后E序才能正常q{ <br /> 试试低版本的Adobe Reader. <br /> 服务器Tomcat上如果L转换p|,应该查这些地? <br /> FlashPrinter打印?打印试?一?不行重装这? <br /> Runtime.getRuntime().exec(cmd) <br /> cmd命o(h)前面不要?"cmd /c ", <br /> 路径:URL的是/,DOS命o(h)是\,q两斜杠千万别搞? <br /> Tomcat~码,可能中文文g名的文g不能转换. <br /> 不行把打印机的权限什么用户都钩上,我就q么q的 <br /> 有什么更好的解决办法告我说啊... <br /> <br /> <br /> -------------------------------------- <br /> <br /> 2010.03.22 补充: <br /> 以前写的东西不详l?惛_补充一? <br /> <br /> 在web中想要用FlashPrinter转换文档的话,用cmdq种方式? <br /> 但是,如果2条命令同时执行就?x)卡M,写一个打CQ务列?CQ务不直接打印. <br /> 惌打印机正?p让FlashPrinter打印机成为默认打印机,q且不受q程桌面?x)话影? <br /> q接q程桌面,?x)生一个打印机?x)?q自动设|成默认. <br /> 此时失L印功?需要保持Macromedia FlashPaper为默认打印机,q不收会(x)话媄? <br /> 如此一?可正常打印所有office文档 <br /> <br /> 导入注册表重启生? <br /> Windows Registry Editor Version 5.00 <br /> <br /> [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services] <br /> "fForceClientLptDef"=dword:00000001 <br /> "fInheritAutoClient"=dword:00000000 <br /> "fDisableCpm"=dword:00000001 <br /> "fAutoClientLpts"=dword:00000001 <br /> <br /> <br /> <br /> <br /> h的开源项?br /> http://code.google.com/p/masterlrg/source/browse/ComponentsLearning/src/PaperLoad/FlashPaperLoader.as?r=44<br /> <img src ="http://www.aygfsteel.com/wangxinsh55/aggbug/317415.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangxinsh55/" target="_blank">SIMONE</a> 2010-04-03 23:16 <a href="http://www.aygfsteel.com/wangxinsh55/archive/2010/04/03/317415.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Flash as 3~程的ȝhttp://www.aygfsteel.com/wangxinsh55/archive/2008/01/27/178047.htmlSIMONESIMONESun, 27 Jan 2008 10:40:00 GMThttp://www.aygfsteel.com/wangxinsh55/archive/2008/01/27/178047.htmlhttp://www.aygfsteel.com/wangxinsh55/comments/178047.htmlhttp://www.aygfsteel.com/wangxinsh55/archive/2008/01/27/178047.html#Feedback0http://www.aygfsteel.com/wangxinsh55/comments/commentRss/178047.htmlhttp://www.aygfsteel.com/wangxinsh55/services/trackbacks/178047.html作?kinglong | 来源:kinglong | 览ơ数:184 | 2007-6-24 22:47:08

最q用AS3写一些项目,在编E过E中Q遇C问题,同时也有一些收获和心得。现在脓(chung)出来希望对大家在AS3~程有一些帮助。如果你发现有说得不对的地方Q你可以指出来,大家一h讨论?br /> 1、AS3的强制类型{?br /> 我之前一直以为是没有q个功能的,而最q在看一些文档,发现q个功能是有的。目前ȝ下来有两U写法:(x)
var loader:URLLoader = URLLoader(event.target);
不知道这U写法是借鉴那种~程语言Q反正我没有见过?br /> 补充q个语法说明Qhttp://livedocs.adobe.com/flash/8_cn/main/00001211.html
var loader:URLLoader = event.target as URLLoader;
q种写法是借鉴VB.Net~程语言Q唉QAS3语法真得一个大杂烩?br /> 2、URLStream和URLLoader
URLStream在文本文件数据方面可以支持多U字W编码?br /> URLLoader在进q测试后Q发现除UTF-8字符~码外,其他字符~码读过来的数据都是q?br /> 可通过ByteArray对象字符~码转换(感谢abc12hjc提供补充代码)Q?br /> public class MoxieAS extends Sprite
{
    public function MoxieAS ()
    {
        var stream:URLStream = new URLStream;
        
        stream.addEventListener(Event.COMPLETE, complete);
        stream.load(new URLRequest("ttt.xml"));  //  <root><a /><b /><c /></root>
    }
    
    private function complete (event:Event):void
    {
        var stream:URLStream = event.target as URLStream;
        var xml:XML = XML(stream.readUTFBytes(stream.bytesAvailable));
        
        trace(xml.*.length());  //  output 3
    }
}
具体用那个方式就看实际功能需求了?br /> 3、URLRequest
URLStream、URLLoader、Loader{读取外部数据的c,里的loadҎ(gu)参数值是URLRequest对象。我在编E过EL喜欢直接写地址字符Ԍ原来?fn)惯改过来看样子要花?gu)间了?br /> 4、Loader
在用Loader来加载数据时Q添加侦听事件时Q注意一定要lLoader?contentLoaderInfo属性增加事Ӟ而不是给Loader对象增加事g。我是因ؓ(f)加错对象Q关键是~译时还没有报错Q,郁闷得差点要把电(sh)脑给扔了?br /> 错误写法Q?br />  var loader:Loader = new Loader();
 loader.addEventListener(Event.COMPLETE, completeHandler);
 loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
 loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
正确写法Q?br />  var loader:Loader = new Loader();
 loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
 loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
 loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
5、Loader加蝲q来的数据类?br /> 此信息来自〖闪无忧?br /> 查看原网址:http://www.5uflash.com/Html/as3/22474444.html

大家知道Loader是用来代替原?MovieClip的loadMovie功能Q用于加载外部的囄文gQSWF文g?br /> 如果加蝲囄文gQjpgQgifQpng{)ӞLoader.content得到数据cd是Bitmap对象Q?
如果加蝲SWF文gQflash 9 版本Q时QLoader.content得到数据cd是MovieClip对象Q?
如果加蝲SWF文gQflash 9 以前版本Q?Ӟ Loader.content得到数据cd是AVM1Movie对象Q?br /> 6、stage
在调试flashq程发现Q如果把swf文g攑ֈhtml面后,stage.stageWidth和stage.stageHeight在第一ơ加载调用时Q他们的gؓ(f)I|
7?AVM1Movie
如果是AVM1Movie 对象Ӟ׃能直接调用stopQplayQgotoAndStop{原来MovieClip对象的功能了Q而且不能AVM1Movie 对象转换成MovieClip对象。目前解军_法:(x)一U是用flash cs3 重新生成 flash 9的swf文gQ另一U是国外|站有说能AVM1和AVM2两个虚拟机相互调用的方式Q脓(chung)一个地址Q;
8、mask
在用遮|功能,发现一个问题,如果不把用于遮罩的显C元仉过addChildҎ(gu)d到同一U的昄容器里的话,遮罩效果显CZ正常Q不知道q个是不是一个bug。我差点因ؓ(f)q个问题而放弃AS3改用AS2?br /> 此信息来自〖闪无忧?br /> 查看原网址:http://www.5uflash.com/Html/as3/22474444_2.html

SIMONE 2008-01-27 18:40 发表评论
]]>
վ֩ģ壺 | | | | | | | ͬ| | | | | ƽ| | | | DZ| | ʯ| | | ޻| ²| | ʯ| «| Ԫ| ֶ| ʡ| | | | α| Ĭ| | | ҵ| | ƽ½| | ˮ|