Flash Layers Move To Right When Child Object Is Resized

Jun 10, 2009

I am having a problem with a flash piece that I created. I don't understand why it is doing what it is doing. I am new to flash but I have been developing software and database applications for over 10 years.I am trying to make a horizontal scroller piece that reads in data from an xml document. So basically the XML has properties of image, title, and link, I then load the images and titles into an object spaced out properly and link the image to open a new window when the image is clicked. I have 4 layers:

1. Actions
2. Buttons
3. Layer1
4. Scroller

The buttons layer has 2 buttons on it, one left aligned and one right aligned. When you mouse over the buttons, the images in the scroller move the direction the button image is pointing. The Scroller Layer has an object of type scroller (which i made) and that scroller instance name is scrollerbar.In actionscript I use a sprite object to load the image and then use scrollerbar.addChild(photo) to add the sprite into the scrollerbar. Then I set it's width, height, x and y to be in the correct position.Now when this first runs, it works displays 6 images and titles and they are linked, and has a button on the left and right. When I mouseover either of the buttons, everything gets moved to the right, the buttons, the scroller, and all the images inside the scroller. So the left button is no longer against the left side, and you can hardly see the right button because it almost gets pushed outside the viewable area.Can anyone explain why everything is getting pushed over like that? It only happens the first time you mouse over a button, subsequent mouseovers of either button do not cause this to happen again.[code]

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Make A Flash Website That Will Have Elements Move In Accordance To When The Window Is Resized

Dec 31, 2008

Over the past few days, I've been trying to figure out how to make a flash website that will have elements move in accordance to when the window is resized. I had got as far as getting it to work in flash when you preview it there. But I tried to publish it and it sits at the TL at its normal size. I had set the html to 100% etc. but to no prevail.[URL]..

I have attached a zip of the files I have- they are unpleasing to the eye and incomplete, but it should get the idea across. Hopefully this doesn't seem like to much to ask. if you can get my ugly Zip.file to publish in Dreamweaver, like it previews in flash.

View 2 Replies

ActionScript 3.0 :: Move Child Movie Clip From One Parent Object To Another?

Dec 26, 2011

I'm having a hard time working out the most appropriate way to move a child movieclip between parent objects.
 
I'm creating a board-game type game wherein I've dynamically created an array of 'Square' movieclips, with no visual elements, which are arranged in a 10x10 rectangle on the stage. I then dynamically add the appropriate types of piece movieclips to the various squares with the addChild() method. In general, a square should only have one child piece at a time.
 
All of this works well for setting up the play area, but now I'm having an issue with moving a piece from one square to another. I want to have the user click a square with a piece on it, then click the destination square to move the piece. I have the logic for determining where a user can move any given piece to, but I don't know how to actually move the piece.
 
The pieces are all different class objects that extend both a base class I call Piece as well as the MovieClip class. The main issue is that when dynamically adding the various pieces to the squares, I don't provide them a unique name to access them later. I don't bother with unique names because I have no way of knowing which piece instance will be in a given square, so using getChildByName(name:String) isn't very useful.
  
So I can think of two routes that I can take: Making a getter/setter for the Square class that manages a private Piece property (as well as the adding and removing of the child piece to/from the parent square), or using getChildAt(index:int) to try to access the child piece.
 
I want to go with the first route as it seems to be the most maintainable to me. My problem is that I can't work out how to manage empty squares in this scenario. My instinct is to null to private _piece property of one square once I've moved the child piece instance to another square... but I'm fairly certain that the private property is a reference type, and nulling it out will null the actual piece object even after it's changed parents.

View 1 Replies

Flash :: Move Movieclips To Unique Layers Using JSFL?

Mar 21, 2011

I have an asset file (FLA) that will be updated a lot by other team members during the project. I would like to have an JSFL script that moves all selected movieclips in the timeline to a new layer (named using the movieclips library name).[code]...

View 1 Replies

ActionScript 3.0 :: Possible To Add Layers / Re-order Layers / Move Movieclips From Layer To Layer

Oct 22, 2008

Is it possible to add layers, re-order layers, move movieclips from layer to layer or specify which layer a duplicate movieclip appears on at runtime with AS3?I am aware of the depth properties and the functions associated with that but it would be easier to have a concept of a layer because I am dealing with masks.I have a nasty feeling I'm gonna be told that layers don't really exist within an swf and that depths and setmask are all there is to work with.

View 4 Replies

Actionscript 3 :: Link Images/layers In Flash CS4 - Making Them Move Together?

Nov 15, 2009

I have two copies of an image (one called blurPic_mc & one called sharpPic_mc) and I want to be able to move both of them around the screen togethe I need them to stay exactly on top of each other for some other functions I am running but right now the only one that moves is the top one (sharpPic_mc).I included my code below.

sharpPic_mc.addEventListener(MouseEvent.MOUSE_DOWN,Click);
sharpPic_mc.addEventListener(MouseEvent.MOUSE_UP,Release);
function Click(event:MouseEvent):void{

[code].....

View 1 Replies

ActionScript 2.0 :: Container_mc Doesnt Move To Center Until Window Is Resized?

Aug 24, 2006

Made first full screen flash. However, container_mc doesnt move to center until window is resized (draged with cursor or minimized then reopened) thus if end user never resizes it container_mc is always half way out of the window. Here is my AS can anyone tell me what I am doing wrong with a pretty in front of that please:

Code:
import flash.display.BitmapData;
container._x = (Stage.width / 2) - (container._width / 2);
container._y = (Stage.height / 2) - (container._height / 2);

[Code]...

View 3 Replies

Flex :: Make FlexMDI Resize It's Child When Window Is Resized?

Oct 2, 2010

I use the addChild(myChild) on a window. but when this window resizes i want to make the myChild width and height to fit the window.

View 1 Replies

Child Of Child Movie Clip Are Null In Imported Object From Flex To Flash Right After Being Created?

Dec 16, 2010

I have an Movie Clip in Flash that have subobject of button type which has subobject of input text and movie clips. Right after creation core Moveclip all subobject are set to null, when I expect them to be valid objects.

[Code]...

MC_Core_design was created in Flash and exported to Actionscript. I've done this for button_1 class aswell. The code was written using Flex. When I comment out both lines that result in error I get correct view of the core Movie clip with all subobject. How can I set subobject properties right after object creation?

View 2 Replies

ActionScript 3.0 :: Possible To Move Layers Into Another One?

Aug 27, 2009

I was wondering is it possible to move layers into another layer. Can I copy movie clip from one layer and paste them into another layer some where else?

View 2 Replies

ActionScript 2.0 :: Object Positioning On A Resized Full Screen?

Jan 29, 2009

There is a small issue that I am not able to solve. Me and my friend are working on a school presentation with many images. The images load as a gallery of piled cards which can be moved and rotated. Now I need to add text on the frame and want it to be aligned to the right of the screen. The stage is aligned to the top left corner. Now the problem is that the text doesn't place itself at the right position on the screen.

View 2 Replies

ActionScript 3.0 :: Layers - Move All Those Objects Together As A One Unit By Some Pixels?

Oct 11, 2011

if there is an option to refer to a layer as a named object. so if I have a layer named 'myLayer' I can to control about the alpha amount, for instance, of all the objects (symbols, movieclips etc.) that inside this layer or to move all those objects together as a one unit by some pixels.

View 5 Replies

ActionScript 3.0 :: Root Variable Not Accessible In Child Layers

Dec 2, 2010

I got a variable "VideoFolder" well defined in my root level. However when I used this variable directly in child layers, my script does not recognize it and I get error 1120: Access of undefined property VideoFolder. I tried changing VideoFolder with _root.VideoFolder in all my child layers scripts, but it changes nothing.

View 2 Replies

Flash - Get All Child Ids Of MyCanvas1.Also For A Specific Mxml Tag Say <mx:Move />?

Apr 25, 2011

How to get all child ids of myCanvas1.Also for a specific mxml tag say <mx:Move /> how to get its id from action script

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

[code]....

View 2 Replies

ActionScript 2.0 :: Movement - Object Move Towards The Mouse When Move The Mouse The Towards The Object And Backwards

Jun 27, 2006

how to do an object move towards the mouse when i move the mouse the towards the object and backwards when i move the move away, something liike the menu on [URL]

View 2 Replies

ActionScript 2.0 :: Move And Loop - Move An Object Across The Stage And Once Out Of Site

Dec 11, 2006

I know this is very noob, but I need a simple AS move and loop. Move an object across the stage and once out of site, loop and start over again? It needs to be a slow and endless loop.

View 3 Replies

Professional :: Create A "Custom Cursor" That Can Move BEHIND Certain Layers?

Jul 10, 2011

In terms of Flash expertise I am on the the doddering divkid level -- but have mananged to create a custom cursor; a hand that I want to move about over most layers but under one specific layer. Currently, no matter the layer order, when published the cursor image jumps straight to the top.

Is there a property I can imbue in the would-be "top" layer or a way of editing or modifying the custom mouse cursor actionscript that would bring about the desired result?

View 6 Replies

ActionScript 3.0 :: Object Placement Detecting Between Layers?

Nov 2, 2009

I am trying to create a system for a Tower Defense that detects if an tower or some structure can be placed on the grid.

The conditions are that the grid must be free of any structures and within the area that allows structures to be built (not on enemy path). I've seen many games do this already, so there's probably something out there. I just can't find it, although I understand the logic.

View 2 Replies

Flash :: Use E.currentTarget To Move An Object In A Function Nothing Happens?

Feb 20, 2010

package {
import flash.display.;
import flash.events.;

[code]....

View 1 Replies

Flash :: Move Object Across Screen Smoothly In It?

Feb 16, 2012

I'm programming a game in as3 using flashDevelop the player (among other things) is moving across the screen using EnterFrame event which update his coordinates while he moves its hard to see details of the animation and its look kinda blur how do i fix this problem?

View 3 Replies

Flash :: AS3: Finding The Child Object You Are Clicking On

Jan 10, 2011

I have a menu MovieClip that has its buttons inside of it. I have the menu with a MousEvent.CLICK and trying to figure a way to register what you are clicking on.

[Code]...

View 2 Replies

ActionScript 3.0 :: Move To Next Child On Stage?

Feb 20, 2009

I have a menu with three buttons and a head "scene" where i present my information. When I push a button in the menu three small pictures are shown on my "scene". Each picture should show a bigger version of the picture and here is the problem. The first picture is shown and it is possible to make it disappear with removeChild. But how do show the other two pictures?! I have tried to do the same as i have done with this picture but with no success.

function visaGolf(e:MouseEvent){
var headBtn:MovieClip = new btn();
headBtn.name = "headBtn";[code]....

View 0 Replies

Actionscript 3 :: Keep Flash From Focusing On Child Object Which Messes Up Tabindex?

Oct 3, 2011

I have a button with a tabIndex. The button contains a textfield.When I click on the edge of the button and hit tab, the next item is correctly focussed.But when I click on the textfield (non-editable,not tab-enabled, no tabindex), and then hit tab, it focusses on the first object on the page, even though the parents focusIn function is triggered, in which I'm setting the focus to the parent object[code]...

View 1 Replies

ActionScript 3.0 :: Flash - Removing Loaded Child Object B4 Loading A New One

Feb 19, 2012

having trouble removing loaded child object b4 loading a new one i can load a child object with this script if button is pressed:

[Code]...

but having difficulty unloading child object when just that mc_char.btn_darkangel button is pressed. Cause otherwise it just adds another instance then another and another and the different instances kinda pile ontop of each other my question is how can i incorporate removeChild script so that mc_char.btn_darkangel doesn't just pile instances of image ontop of each other

View 2 Replies

Flex :: Move Shape Object Across Screen- Initial Object Remains

Jun 25, 2011

I am trying to move a 'Shape' object across the screen. As the object moves, a copy is being left at the initial position. Almost as if only an instance of original object ahs been moved

This is not an issue for moving an image or MXML graphic. Is something wrong in setting to the move object?

The code is as follows

private var arrow:UIComponent;
private function resetAssets():void{
arrow = new UIComponent();

[Code].....

View 1 Replies

Flex :: Move The Child Only Inside The Parent?

Feb 4, 2010

Recently I worked in a project using Flex. Its a Photo editing project. I have took a Canvas and take a image in that canvas using the code canvas.addChild(image) . Now i can move the image freely by using moving code. The image move inside the canvas and outside the canvas. I want to move the image/child only inside the canvas not outside. How can i do this?

View 1 Replies

Flex :: Move Dynamic Child Or Element?

Dec 25, 2011

It's possible to move a dynamic ctreated element or child? Example:

Create childs:

public function createChilds():void {
for(var i:int=0; i < 10; i++) {
newImage = new Image();[code]...........

View 1 Replies

ActionScript 3.0 :: Listening For Custom Event Dispatched From Parent Object In Child Object?

May 25, 2010

I want to listen for a custom event dispatched from the document class in a custom subclass. For example, let's say in the document class I have:

ActionScript Code:[code]....

So that the subclass will trace 'Event from document class received' when the 'customEvent' event from the document class is listened by the eventlistener. However, the output is only 'customEvent dispatched', meaning it wasn't heard in the subclass.

View 7 Replies

ActionScript 3.0 :: Make An Object Point In The Direction Of Another Object And Move Towards?

Aug 19, 2009

I'm still new to AS3, and I was wondering how to make an object point in the direction of another object and move towards it if they are a certain distance from one another. I haven't been able to find out how to do this from the Adobe devnet, so I thought I'd ask here.

View 1 Replies

Flash :: Make A Animation That Makes An Object Move Across The Screen To A Certain Point?

Sep 1, 2011

I want to make a flash animation that makes an object move across the screen to a certain point, depending on what is typed into a text box, and i want many of these moving objects at once, so that you can type in a number and then the object moves to that point. Can this be done?I have used flash but have done verry little with the actions of flash, so please walk me through any actions that will need doing

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved