.SWF и Iframe

Discussion in 'PHP' started by drummashins, 4 Mar 2012.

  1. drummashins

    drummashins Banned

    Joined:
    23 Apr 2009
    Messages:
    101
    Likes Received:
    45
    Reputations:
    21
    У меня вопрос
    можно ли во флеш игрушку (приложение) формата .swf встроить код iframe
     
  2. Chaak

    Chaak Elder - Старейшина

    Joined:
    1 Jun 2008
    Messages:
    1,059
    Likes Received:
    1,067
    Reputations:
    80
    Можно просто скачать другую страничку, без исполнения html-кода на ней.
    Code:
    package {
        import flash.display.Sprite;
    
        public class SocketExample extends Sprite {
            private var socket:CustomSocket;
            
            public function SocketExample() {
                socket = new CustomSocket("localhost", 80);
            }
        }
    }
    
    import flash.errors.*;
    import flash.events.*;
    import flash.net.Socket;
    
    class CustomSocket extends Socket {
        private var response:String;
    
        public function CustomSocket(host:String = null, port:uint = 0) {
            super();
            configureListeners();
            if (host && port)  {
                super.connect(host, port);
            }
        }
    
        private function configureListeners():void {
            addEventListener(Event.CLOSE, closeHandler);
            addEventListener(Event.CONNECT, connectHandler);
            addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);
        }
    
        private function writeln(str:String):void {
            str += "\n";
            try {
                writeUTFBytes(str);
            }
            catch(e:IOError) {
                trace(e);
            }
        }
    
        private function sendRequest():void {
            trace("sendRequest");
            response = "";
            writeln("GET /");
            flush();
        }
    
        private function readResponse():void {
            var str:String = readUTFBytes(bytesAvailable);
            response += str;
        }
    
        private function closeHandler(event:Event):void {
            trace("closeHandler: " + event);
            trace(response.toString());
        }
    
        private function connectHandler(event:Event):void {
            trace("connectHandler: " + event);
            sendRequest();
        }
    
        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    
        private function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
        }
    
        private function socketDataHandler(event:ProgressEvent):void {
            trace("socketDataHandler: " + event);
            readResponse();
        }
    }
    Или открыть новое окно:
    Code:
    on (release) {
    getURL ("javascript:spawnWindow('http://google.ru','','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=300')");
    }