English 中文(简体)
检测出牛体大小。 flex/as3
原标题:detect the size of swf. flex/as3

我绘制了一份有切身利益的地图。 (POI) 当用户在POI上变相时,便装在屏幕上,并装上 s。 我目前有3个问题。 我的第4个问题是,这是定于21世纪的第21周结束的。 那么,将非常感激任何帮助。

  1. 我可以发现 s的大小,这样,我心脏的泡沫将体积到 s的大小。

  2. 当我篡改我的手法时,它就消失了。

  3. 我将热爱把我的手 file放在自己的一层,而不是放在我的主要手法的舞台上......但我没有这样做。

www.un.org/Depts/DGACM/index_spanish.htm

package com.modestmaps
{
import flash.display.Graphics;
import flash.display.Loader;
import flash.display.Shape;
import flash.display.Sprite;
import flash.filters.BlurFilter;
import flash.geom.Matrix;
import flash.geom.Rectangle;
import flash.net.URLRequest;
import flash.text.TextField;

public class InfoBubble extends Sprite
{
public var textField:TextField;
public var background:Shape;
public var shadow:Shape;

public function InfoBubble(text:String)
{
//I name the instance of my POI marker on my map to the url link of my swf file. So whatever marker i click on the correct url will
this.name = urlLink;

this.mouseEnabled = true;
this.mouseChildren = false;

//this creates a shadow behind my infobubble
shadow = new Shape();
shadow.filters = [ new BlurFilter(16, 16) ];
shadow.transform.matrix = new Matrix(1, 0, -0.5, 0.5, 0, 0);
addChild(shadow);

background = new Shape();
addChild(background);

textField = new TextField();
textField.selectable = true;
textField.multiline = true;
textField.wordWrap = true;
//textField.text = urlLink;


textField.width = textField.textWidth+300;
textField.height = textField.textHeight+288;
//addChild(textField);

var request:URLRequest = new URLRequest(urlLink);
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);

//marker clips are positioned with (0,0) at the given location
//current measurements of swf file w432 h288
//if i could dynamically determine the size of the loaded swf file its position would be automatically calculated

loader.y = -288 - 37;
loader.x = -8;


//marker clips are positioned with (0,0) at the given location
textField.y = -textField.height - 35;
textField.x = -10;

//currently my rectangle s size is determined by the textField size. I don t even use the textfield. I want the rectangle to be drawn using the dimensions of the swf file instead.
var rect:Rectangle = textField.getRect(this);

// get your graph paper ready, here s a "speech bubble"
background.graphics.beginFill(0x12345);
shadow.graphics.beginFill(0x000000);

for each (var g:Graphics in [ background.graphics, shadow.graphics ] ) {
g.moveTo(rect.left, rect.top);
g.lineTo(rect.right, rect.top);
g.lineTo(rect.right, rect.bottom);
g.lineTo(rect.left+15, rect.bottom);
g.lineTo(rect.left+10, rect.bottom+15);
g.lineTo(rect.left+5, rect.bottom);
g.lineTo(rect.left, rect.bottom);
g.lineTo(rect.left, rect.top);
g.endFill();
}
}
}
}

我希望,更熟练的法典家能够帮助我。 I m New to flex and as3

Edit: There is no javascript in this file. All of it is AS3. Edit2: This is the temporary site I am testing it on http://cjbutchershop.com/temp/adtypes/mapTest.swf

问题回答

你们可以通过做以下工作来达到申请的大小:

var width:int = Application.application.width;
var height:int = Application.application.height;

关于当你 h倒无益的泡沫时,案文消失的问题;你不妨重新考虑你的做法。 我没有装上外壳,而是针对适当的改变活动,在我的标识物体(如文字现场)上添加/移除儿童物体(如扩大仪式),从而对小地图进行了设计。

I am new to Flex myself, but i have done something similar while trying out an example while learning. Basically what i suggest is Open the bubble in a new popup window using the PopUpManager class on MouseOver event on the parent window (on your map). And show the popup in a TitleWindow Component,also tap the close event on Title window component.That way you will come back to the same page.Hope this helps.

在这里张贴代码

< ? xml version="1.0" encoding="utf-8" ? >
< mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

<mx:Script>
    <![CDATA[
        import mx.events.ListEvent;
        import mx.controls.Alert;
        import mx.managers.PopUpManager;
        import mx.rpc.events.ResultEvent;
        import mx.collections.ArrayCollection;

       [Bindable]
       public var photoFeed:ArrayCollection;

        public function searchFlickr():void {
            photoService.cancel();
            var params:Object = new Object();
                params.format =  rss_200_enc ;
                params.tags = srchTxtId.text;               
            photoService.send(params);
        }

        public function resultHandler(event:ResultEvent):void {
            photoFeed = event.result.rss.channel.item as ArrayCollection;
        }

        public function openPanel(levent:ListEvent):void {
            var panelCmpObj:panelcomp = new panelcomp();    
               panelCmpObj.source = levent.itemRenderer.data.content.url;           
            PopUpManager.addPopUp(panelCmpObj,this,true);
        }
        public function test():void {
            Alert.show( testtest );
            }           

    ]]>
</mx:Script>

<mx:HTTPService id="photoService" url="http://api.flickr.com/services/feeds/photos_public.gne" result="resultHandler(event)"/>

<mx:HBox width="362" height="24">
    <mx:TextInput id="srchTxtId"/>
    <mx:Button label="Search for pics" id="srchBtnId" click="searchFlickr()"/>
</mx:HBox>
<mx:TileList id="imgTileList" dataProvider="{photoFeed}" width="100%" height="100%" itemClick="openPanel(event)">   
<mx:itemRenderer>
    <mx:Component>
      <mx:VBox width="125" height="125"
            paddingBottom="5"
            paddingLeft="5"
            paddingTop="5"
            paddingRight="5">
            <mx:Image width="75" height="75" source="{data.thumbnail.url}"/>
      </mx:VBox>
    </mx:Component>
</mx:itemRenderer>
</mx:TileList>

CODE FOR THE COMPONENT shown on PopUP
< ? xml version="1.0" encoding="utf-8" ? >
< mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" showCloseButton="true" styleName="noPadding" creationComplete="init();" close="titleWindow_close(event);" >
< ![CDATA[ import mx.managers.IFocusManagerComponent; import mx.controls.Alert; import mx.core.IFlexDisplayObject; import mx.events.CloseEvent; import mx.managers.PopUpManager;

        [Bindable]
        public var source:String;

        private function init():void {
            PopUpManager.centerPopUp(this);
        }

        private function titleWindow_close(evt:CloseEvent):void {
            PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
        }
    ]] >
< /mx:Script>

< mx:Image width="379" height="261" id="imgId" source="{source}"/>
   <mx:ControlBar horizontalAlign="right" width="100%">
</ mx:ControlBar>

提炼; /mx:TitleWindow >

“你试图从胎儿泡沫中获取应用规模吗? 为什么在一个单独的 s子中,胎儿泡沫是怎样的? 如果你有不易碎的源码,我建议将其添加到你的地图应用中,并直接瞬息万变的物体。 • 2小时前

我有三种不同类型的胎儿泡沫(只显示静态泡沫)。 我的一些信片有移动内容。 我没有考虑泡沫中外部阴道的大小,即体积。 居住在泡沫的外壳的高度和宽度。 如果我知道高和宽度,我就能够有与高和宽度相匹配的胚胎。 现在,我手脚的泡沫硬化成现件泡沫的大小;然而,那将具有不同的胎儿泡沫卷体。





相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签