ActionScript 2.0 :: Intervals Using Relative Object Positioning?
Feb 20, 2007
check this code out:
[Code]...
I was wondering, is there a way to change if (myClip_mc._x < 400) { to a relative position of myClip_mc. I mean, i want myClip_mc to move 100px from it's current position everytime the button is clicked. Instead of only moving it if it's x position is less than 400. So it needs to somehow check it's current position everytime the button is clicked and then make it shift from that position. I know this is a long winded way of doing it but i want it this way so i can use it for something different.
View 8 Replies
Similar Posts:
Feb 13, 2009
I'm looking to create something like the link below, [URL].. however I need it to work on both x and y,I've been trying for days to figure out a way to pull this off,
can anyone point me to a tutorial or an example of something along those lines?
View 5 Replies
Feb 13, 2009
I'm looking to create something like the link below,
[URL]
However I need it to work on both x and y.
View 2 Replies
Aug 31, 2010
I need to position an object in the bottom half of a container (working on flex 4)- abt 25% above the bottom...and cant use x,y coordinates given need for resizing. I have been able to position the layout containers and they work well
Also need fonts to resize as the buttons get smaller
View 1 Replies
Jul 28, 2009
I have a movieClip inside a parent movieClip on the stage. The parent movieClip's registration point is top left. I'm having trouble figuring out how to "center" (move) the parent movieClip so that it's child movieClip is in the center of the stage. How do I calculate those destination coordinates?
View 2 Replies
Jun 8, 2010
I have been wondering over this for a while now and I have tried a number of different soloutions to no avail. I am used to designing HMTL website but for a portfolio I would like to create a Flash site. One problem is dynamic screen sizes, although I have a soloution it isn't idealy what I would like.
My current soloution is to size the stage to a 1024 x 768 resoloution and scale it to 100% on a webpage. The background for my flash is massive, 1920 x 1080, equivelent to full HD size, to support as many screens as possible, the flash has a No Scale atribute. Unfortunatly this method dosen't only increase filesize, but makes the content restricted to a small area of the screen which looks terrible on large displays.
View 8 Replies
Dec 28, 2010
Whe I use the code below in a template set up as a movie clip it appears and works fine but when i nvagate away from it the relative alignment code remains for the rest of the pages. Would use a remove child how would this look?
[Code]..
View 5 Replies
Jul 4, 2010
I have a flex component like this:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
...
width="100%"
[code].....
View 4 Replies
Sep 23, 2010
I have one Sprite which acts as a container for two other Sprites. One has a picture the other has a series of hotspots.
If i change the scaleX and scaleY of the picture, the hotspots don't line up anymore. Do you know the correct equation so that any scale i set will always make the hotspots appear at the right place?
I'm trying stuff like this:
hotspot.x *= scaleFactor;
hotspot.y *= scaleFactor;
but i can't quite sort it.
View 1 Replies
Jul 11, 2011
I just started learning Flash as part of a project, consisting of a spider-like figure which is supposed to vibrate every 20 seconds. I've basically got the vibrating to work but am having more trouble learning about getting it to vibrate at different intervals. I was hoping that someone here could point me in the right direction as to where to find this information, even an applicable tutorial or something.
View 6 Replies
Nov 30, 2006
panning my content from left to right (with stop as intervals) then right to left (also with intervals)
1. I created an mc (name: "content")Notice in this mc, I layout 4 sets of text (like a page) from left to right
2. I created another mc (name: "pancontent_mc")
-I added a layer for "content" and created a motion tween for it to pan from left to right
-I created a mask layer on top of "content" that will show 1 set at a time
-I created an action layer that has total of 4 stops(); on each frame where the 4 sets of text will show directly under the mask.
3. maintimeline -There's only 1 layer. I placed an instance of buttons (left/right) and an instance of "pancontent_mc"
4. actions for right button, works fine and stops on each set of text.
on (release) {
this.pancontent.play();
}
5. actions for left button - none. I havent figured this out yet.
on (release) {
this.pancontent. - something like play previous frame until stop...
}
View 3 Replies
Jun 28, 2009
How should I set the Co-ordinates of one object relative to another?
Eg: Balloon, Monkey
If I need the Monkey co-ordinates fixed relative to the Balloon only and my Global or Stage Co-ordinates fixed at the Top - Left hand corner should not affect my Monkey's movements.
i.e Monkey's co-ordinates computed with respect to Balloon's only.
View 1 Replies
Feb 16, 2012
I've seen code where an object can be added relative to another but I can't get it to work. I'm just trying to draw a rectangle and then add another smaller rectangle relative to the first
public var rectangle:Sprite = new Sprite();
public var other:Sprite = new Sprite();
rectangle.graphics.beginFill(0xFF0000);
[Code].....
Both rectangles just end up rendered relative to the stage.
View 1 Replies
Jun 26, 2009
I have made a class file player and another class file landscape. The player class file has methods that allow the player to move. Where would I put code to make the landscape move with the player? Would the code go into the player class file or the document class file? I don't know how I could link the landscape movement with the player movement
player.as class file
Code:
//the package
package actionscript{
import flash.display.*;
import flash.events.*;
import flash.media.*;
[Code] .....
View 2 Replies
Jul 12, 2010
Here's the issue. Say you have a Sprite, on this sprite you have 2 other sprites positioned precisely. For example, you have a Character Sprite. On this Character Sprite it has 2 children, the base, and the hair. It's very important that they're positioned precisely for it to look correctly. Now say for moving the character you have some tweens in place. You tween the character object that contains both the base and the hair sprites. Sometimes, not always but quite frequently, afterwards the two sprites within the character sprite (base and hair) aren't positioned correctly.
View 2 Replies
May 17, 2011
If I have a rectangle on the stage, how do I find its top left tip (x,y) and the bottom right tip (x,y) in relation to the stage?
View 2 Replies
Jan 28, 2010
I have an flash file which is 740px wide and a movie object inside it which is 1100px wide. What I want to happen is for the movie to scroll left or right depending on the mouse position and to stop when it reaches the start or end of the movie object. It all works fine except when it gets to either end, the _x position is outside the boundaries I have set in the if statement so it wont scroll back again.Code is below:
ActionScript Code:
onClipEvent (load)
{
[code]....
View 2 Replies
May 9, 2009
I have made a tooltip class for my project and I want to position the tooltip relative to the object that triggered it.e.g.
Code: Select all_button = new CustomButton("CLICK ME");
_button.addEventListener(MouseEvent.ROLL_OVER, showTooltip);
private function showTooltip():void
{
[code]...
How can I access the _button without hardcoding it like that?
View 9 Replies
May 4, 2011
trying to loop out some pictures using a for loop and cant get them to be posiotioned directly beneath the previous picture, I have set the height number in my xml where I get the pictures from.[code]This is how the code should look like if you are trying to place pictures directly beneath the previously added picture using a class with parameters, in this case the "LoadExternaly" is that class.
View 1 Replies
Jul 20, 2010
so i am giving these objects random x and y coordinates on the stage, but i need each object to be spaced apart from each other (lets say 20px) how can i achieve this. I have got the following code:
ActionScript Code:
for(var i:int=0;i<=bubbleNumber;i++){
var bubble:Bubble = new Bubble();
[code].....
View 2 Replies
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
Jul 6, 2009
I am new to Flash and ActionScript 3.0 environment. I don't have any knowledge in depth with Flash and ActionScript 3.0. I am using the flash(.swf file) in my Java application. Now, this .swf file is to be placed in the server system. While I am working with these, I faced an error. Here, my issue/problem(s) starts....
1.)With the help of URLRequest & URLLoader classes, I am loading a jpg file dynamically onto the stage using the following code:
[Code]...
View 1 Replies
Jun 18, 2009
I'm having some issues with a thumbnails scroll that I found in another forum. I was able to modify it to fit my needs, but now I want to incorporate a interval that plays my next image without having to click on the buttons. I have tried several methods but nothing seems to work. here is the code:
descriptions=true;
alert._visible=false;
var ease = 5;
[Code].....
View 4 Replies
May 1, 2009
basically what im trying to do is have a basic countup timer that goes in intervals of three. (3,6,9,12,15,ETC.) but it has to run with a 12 fps and not stop. also this cannot be 1000 frames long .
View 12 Replies
Nov 26, 2009
I am working on a project and it is almost there basicly its a cracker that opens after a set interval of 1500,
I then want it wait for 20 seconds and open again and in a loop every 20
I have tried clearInterval but doesn't work for me
heres my code & fla attached
Code:
//IMPORT TWEEN ENGINE START
import mx.transitions.Tween;
import mx.transitions.easing.*;
//IMPORT TWEEN ENGINE END
[Code]....
View 0 Replies
Jan 18, 2011
I've got one function that I'm running, but I need it to run at different times for different movie clips.Here's my code. What is wrong with this?
ActionScript Code:
function tweenText(_TEXT:MovieClip, _START:Number, _END:Number, _SEC:Number, _INTERVAL:Number) {
var xTween:Tween = new Tween(_TEXT, "_x", Strong.easeOut, _START, _END, _SEC, true);
clearInterval(_INTERVAL);
[code]....
View 2 Replies
Jul 31, 2010
I'd like to change a timer interval, In my code I first initialize the timer with a selected interval with :
Code:
gameTimer=new Timer(interval,0);
gameTimer.addEventListener(TimerEvent.TIMER, IALoop);
gameTimer.start();
Then, I need afterwards to change the interval, so I try to stop the timer, remove the listener
Code:
gameTimer.stop();
gameTimer.removeEventListener(TimerEvent.TIMER, IALoop);
And when I init again the timer with the same code:
Code:
gameTimer=new Timer(interval,0);
gameTimer.addEventListener(TimerEvent.TIMER, IALoop);
gameTimer.start();
It's like if i had 2 timers, and when i stop the timer, it continues, I guess it's because of the new object that I create, but I can't found a method to change the interval of the existing timer..
View 2 Replies
Nov 11, 2002
i 'd like to know if there is a way to clear all Intervals in a movie with one command.in my current project I use setInterval()very often in different clips and though i cleanly put the corresponding clearInterval() commands in the script I realized, that on slow computers some of them don't get stopped.Which puts more weight on the CPU and sometimes slows down the comp very much.
View 9 Replies
Jan 25, 2011
I am working on a project that need to countdown what is in stock.
Right Now I have the banner counting down but how do I get it to count in different intervals?
Right now I have an interval setIt = setInterval(this, "counter", 8000);
But I want it to go form 8 sec. to 1 sec. to 8 sec.
View 3 Replies
Jan 20, 2010
I am working on a Flash Video player and am implementing the ability to start a video at x time within the span of an FLV (served from FMS). I am able to start it x seconds into a stream without any issue using
netStream.play(source, startTime);
but as far as I can tell, it only supports seconds. I am looking to be able to give a start time (or even a seek time if that is supported) in milliseconds, or really anything more precise than whole seconds.
Anyone know of any way to achieve this even by monkey patching the fl classes?
View 1 Replies