github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

alimills / navigatetowindow

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 4
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: e81fef1

click here to add a description

click here to add a homepage

  • Branches (1)
    • master
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

navigateToWindow() is a package-level ActionScript function that encapsulates the logic around opening a browser popup window — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

replacing incorrectly named statusbar with status 
alimills (author)
Wed Apr 29 14:19:33 -0700 2009
commit  e81fef17d80db50b57e1b12979ad6a9630460e87
tree    4a71eda670072bdcfa913603f01d70ead2a66e83
parent  371701446d373f20a048ca74de33f7f8361b2b05
navigatetowindow / test / patternpark / net / NavigateToWindowTest.as test/patternpark/net/NavigateToWindowTest.as
100644 94 lines (76 sloc) 2.987 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package patternpark.net {
 
    import asunit.framework.TestCase;
    
    public class NavigateToWindowTest extends TestCase {
        private var instance:NavigateToWindowExample;
 
        public function NavigateToWindowTest(methodName:String=null) {
            super(methodName)
        }
 
        override protected function setUp():void {
            super.setUp();
            instance = new NavigateToWindowExample();
        }
 
        override protected function tearDown():void {
            super.tearDown();
            instance = null;
        }
 
        public function testNavigateToWindow():void {
            addChild(instance)
        }
    }
}
 
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.TextEvent;
import flash.geom.Point;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
 
import patternpark.net.navigateToOverlay;
import patternpark.net.navigateToWindow;
 
class NavigateToWindowExample extends Sprite {
    private var navWindow:TextField;
    private var navOverlay:TextField;
    private var navWindowText:String = "<a href='event:http://www.patternpark.com'><u><font color='#0000FF'>open popup from SWF to Pattern Park</font></u></a>";
    private var navOverlayText:String = "<a href='event:http://www.patternpark.com'><u><font color='#0000FF'>open overlay from SWF to Pattern Park</font></u></a>";
    
    public function NavigateToWindowExample() {
        initialize();
        createChildren();
    }
 
    protected function initialize():void {
        navWindow = createTextField(navWindowText, windowLinkHandler);
        navOverlay = createTextField(navOverlayText, overlayLinkHandler);
    }
    
    protected function createTextField(text:String, linkHandler:Function):TextField {
        var textField:TextField = new TextField();
        textField.htmlText = text;
        textField.autoSize = TextFieldAutoSize.LEFT;
        textField.border = true;
        textField.background = true;
        textField.addEventListener(TextEvent.LINK, linkHandler);
        return textField;
    }
 
    protected function createChildren():void {
        var window:DisplayObject = addChild(navWindow);
        window.x = window.y = 200;
        
        var overlay:DisplayObject = addChild(navOverlay);
        overlay.x = overlay.y = 300;
    }
 
    protected function windowLinkHandler(linkEvent:TextEvent):void {
        var winFeatures:Object = {
            toolbar:0,
            scrollbars:0,
            location:0,
            status:0,
            menubar:0,
            resizable:0,
            width:400,
            height:300,
            top:200,
            left:200
        };
 
        navigateToWindow(linkEvent.text, "newWin", winFeatures);
    }
 
    protected function overlayLinkHandler(linkEvent:TextEvent):void {
        var point:Point = new Point(this.x, this.y);
        navigateToOverlay(linkEvent.text, {width:400, height:300, top:point.x, left:point.y});
    }
}
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server