简体   繁体   English

如何在Flash中添加容器或面板并使用ActionScript 3.0调整其大小

[英]How to add container or panel in flash and resize them using actionscript 3.0

I want to show some image in a flash. 我想在一瞬间显示一些图像。 When I click an image, the image is up as like as image shown below. 单击图像时,图像将如下图所示向上移动。 在此处输入图片说明

在此处输入图片说明

when i click the image: 当我单击图像时: 在此处输入图片说明

but the problem is when i click the image in that group, there is a gap between images. 但是问题是当我单击该组中的图像时,图像之间存在间隙。 I want to attach them. 我想附上它们。 I can not solve the problem. 我无法解决问题。 please anybody help me to solve the problem. 请任何人帮助我解决问题。

If you're using Flex, this is fairly trivial. 如果您使用的是Flex,那将是微不足道的。 You set the cards in an HGroup (calculating the gap will be difficult, but not impossible) and simply remove selected cards from that group and place them in another. 您将卡设置在一个HGroup (计算gap将很困难,但并非不可能),只需从该组中删除选定的卡并将其放置在另一个卡中即可。 After the card is removed, your other cards will be realigned by the layout automatically. 取出卡后,您的其他卡将根据布局自动重新对齐。

If you're not using Flex, I suggest extracting the code you used to layout the cards in the first place into a separate function. 如果您不使用Flex,建议您将用于首先布局卡的代码提取到单独的函数中。 When a card is selected, you move the card out of the DisplayObjectContainer it is currently in and place it in another and then simply call the layout function again. 选择卡后,将卡从当前所在的DisplayObjectContainer移出并将其放置在另一个卡中,然后再次简单地调用布局函数即可。 This is the same method as I would use with Flex, although a little less automated due to the lack of Flex's layout engine. 这与我使用Flex时使用的方法相同,但是由于缺少Flex的布局引擎,自动化程度有所降低。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM