当前位置: 代码迷 >> Web前端 >> 3d成效显示文字
  详细解决方案

3d成效显示文字

热度:301   发布时间:2012-11-09 10:18:47.0
3d效果显示文字
<?xml version="1.0" encoding="utf-8"?>
<!--created:Sep 28, 2010 file:StateDemo1.mxml  author:Michael -->
<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"
               backgroundColor="0"
               viewSourceURL="srcview/index.html"
               width="100%"
               height="100%">
    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @font-face {
            src: url("assets/armalite.ttf");
            fontFamily: myFont;
            embedAsCFF:true;
 
        }
        s|Label
        {
            font-size:50;
            font-family:"myFont";
            line-height:120;
            text-align:center;
            padding-top:500;
            padding-bottom:400;
 
        }
    </fx:Style>
    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            private var myTimer:Timer;
 
            protected function bc_creationCompleteHandler(event:FlexEvent):void
            {
                this.myLabel.text="Robert Downey Jr.
Don Cheadle
Scarlett Johansson
Gwyneth Paltrow
Sam Rockwell
Mickey Rourke
Samuel L. Jackson
Clark Gregg
John Slattery
Garry Shandling
Paul Bettany
Kate Mara
Leslie Bibb
Jon Favreau
Christiane Amanpour";
                scroller.setStyle("verticalScrollPolicy", "off");
                this.myTimer=new Timer(100);
                this.myTimer.addEventListener(TimerEvent.TIMER, onChange);
                this.myTimer.start();
                this.myRoate.play();
 
            }
 
            private function onChange(e:TimerEvent):void
            {
                var temp:Number=this.scroller.verticalScrollBar.value;
                if (temp < this.scroller.verticalScrollBar.maximum)
                {
                    this.scroller.verticalScrollBar.value=this.scroller.verticalScrollBar.value + 7;
                }
                else
                {
                    this.myLabel.visible=false;
                    this.scroller.verticalScrollBar.value=0;
                    this.myLabel.visible=true;
                }
            }
        ]]>
    </fx:Script>
 
    <fx:Declarations>
        <s:Rotate3D target="{bc}"
                    angleXFrom="0"
                    angleXTo="-70"
                    autoCenterTransform="true"
                    id="myRoate"/>
    </fx:Declarations>
 
    <s:BorderContainer width="100%"
                       height="100%"
                       backgroundImage="@Embed('images/images.jpg')"
                       backgroundImageFillMode="repeat">
        <s:layout>
            <s:VerticalLayout horizontalAlign="center"
                              verticalAlign="middle"/>
        </s:layout>
 
        <s:BorderContainer width="600"
                           height="400"
                           backgroundAlpha="0"
                           id="bc"
                           creationComplete="bc_creationCompleteHandler(event)"
                           borderVisible="false">
 
            <s:Group width="100%"
                     height="100%">
                <s:Scroller width="100%"
                            height="100%"
                            id="scroller">
                    <s:Group width="600"
                             clipAndEnableScrolling="true">
                        <s:Label id="myLabel"
                                 width="100%"
                                 color="0x4094f2"/>
                    </s:Group>
 
                </s:Scroller>
                <s:BorderContainer width="100%"
                                   height="200"
                                   top="0"
                                   backgroundAlpha=".6"
                                   backgroundColor="0"
                                   borderVisible="false"/>
 
            </s:Group>
        </s:BorderContainer>
    </s:BorderContainer>
</s:Application>
?

?

  相关解决方案