ActionScript 2.0 :: Put A Movieclip On The Screen For Text ?
Jul 14, 2010
I'm making a tile-based game and for most of the game, your character is on a tile-based array. But I needed to be able to put a movieclip on the screen for text, and putting it onto the screen the normal way wouldn't work because it would be below the tile-based array.
So I used this code to attach it:
It worked! But then the problem came up... how would I make it so that when you press A, it would go to the next frame? Two problems actually.... one is that I don't know how to put code "on" the movieclip, only inside its timeline, and two I don't know what code to use to make it go to the next frame, for example if its on frame 1 go to frame 2, if its on frame 4 it would go to frame 5.
I used this code inside the first frame of the movieclip:
But only the stop part of it works.
65 is the key code for A, by the way.
View 9 Replies
Similar Posts:
Aug 12, 2011
I have a problem regarding text appearence on screen. I have few TFL dynamic text fields in CS5.5 that update each time according to users choises (a dictionary, in hebrew if it matters). As a text field I can't break lines or organize the text in paragraphs or any other way, the corrent situation is a text block that is not pleasent to read, it's need to be organized (it's for children so it has to be as clear as possible).
[Code]....
View 6 Replies
Jul 28, 2011
i am wondering from this code, it makes the stage full screen, does it also makes the content of my movieclips scaled to full screen? i have tried this code and it does not seem to do that, how can i make my content to scale to fill a stage's full screen? i have a Movieclip containing a background with a class to make special effects on the background, i am having trouble making the background be "fullscreened" nicely with the stage.
View 1 Replies
Sep 4, 2011
I've 3 different MovieClips that I need to move at the same time across the screen. (From bottom to top) What is the best way of doing this without using a tweening class like Caurina?
View 2 Replies
Oct 23, 2007
I am using MX 04 and I have a rather large background for my movie 2046x396 and I made it into a mc to pan right to left... it looks ok in the designer and plays fine in the library, but with I testrun the movie it looks like the image is getting smeared on the screen... the movie speed is 60fps and the background mc I have tried from 100 to 300 frame motion tween.
View 0 Replies
Sep 22, 2009
say i have a stage that is 2000 px high..let's say there are buttons spread out from top to bottom and also,lets say pressing anyone shows a related MC..how do i make that MC center to the screen (not the stage) wherever i may have scrolled to?the only thing i have found after an extensive google session is somevague tip about using externalInterface and retrieving the position of the browsers native scroller from javaScrip ..but seems like a bit too much work, there's gotta be an easier way to do this.
View 2 Replies
Jun 23, 2009
Basically, I have a BitmapData object which is acting as a virtual screen.
I have a MovieClip which I want to render to the bitmap using the same transformation as though the bitmap were the screen. However, the MovieClip is not attached directly to the root
The BitmapData.draw() method takes a Matrix as an optional parameter, which I think I need to set as the MovieClip's localToGlobal transformation matrix. However, I don't know how to obtain or construct this!
View 2 Replies
Sep 21, 2009
I'm making a lightbox type of effect in flash. How would I go about making the semi transparent layer that covers up the background fill the screen so if the screen is readjusted it remains covered?
View 2 Replies
Jan 30, 2009
stop a movie clip..... here is my code:
ship_mc.onEnterFrame = function() {
ship_mc._x += 15;
}
What I need is this clip to move until x = 151, then stop. My spaceship will fly across the screen and then stop in the center...how do I make it happen?
View 1 Replies
Feb 15, 2010
Imagine we have a MovieClip called "box". When I click somewhere on the screen, I want the box MC to move to that position. So I wrote something like this (just for horizontal movement):
PHP Code:
onMouseDown=function(){moveTo(_xmouse);};
function moveTo(newx){box.onEnterFrame=function(){if(box._x<newx){box._x+=5;
}else if(box._x>newx){box._x-=5;}else{delete box.onEnterFrame;}};}
Now this works to a degree, except that when the box MC moves to the right position, it then proceeds to vibrate on the spot. I thought it was probably because it can never move to the exact position of _xmouse because I'm adding 10 to the x property which is why the condition is never met. However even if I just add 1 instead of 10, I still have the same problem..
View 3 Replies
Feb 4, 2011
I have created a shooting game and I am struggling to create a splash screen at the beginning informing the user of the controls with a button to start the game, which removes the splash screen. I am trying to add the splash screen in the main timeline using addChild event. I can get the splash screen to appear on the game and remove it when the playgame button is pressed, but this prevents all the other event listeners so I am not able to fire or move the ship.
In the splash screen I have the code :
Play_btn.addEventListener(MouseEvent.CLICK,playgame)
function playgame(e:Event):void{Play_btn.removeEventListener(MouseEvent.CLICK,playgame)
parent.removeChild(this); }
and in the main timeline I have :
addChild(splashscreen);
View 2 Replies
Nov 19, 2010
I have an animated MovieClip of a fly that spawns at a random location and moves across the screen by bouncing off the walls. But every time the animation starts over, it seems to "jump" to a random location. Here is the code I have for when it spawns:
private function beginClass(e:Event):void{
_root = MovieClip(root);
do {
[Code].....
How do I fix it so that the fly continues moving in its appropriate path every time the animation starts over?
View 1 Replies
Nov 19, 2010
I have an animated MovieClip of a fly that spawns at a random location and moves across the screen by bouncing off the walls. But every time the animation starts over, it seems to "jump" to a random location. Here is the code I have for when it spawns[code]...
View 1 Replies
Apr 2, 2009
i would like to know how to make text to appear on the screen as if im writing it...with my mouse or hand or whatevs?
View 2 Replies
Jan 30, 2012
1: When I get back to my main game screen, how do I keep my MovieClip in the same place it was before.
2: When I run this code:
Code:
if(numberOfGras**** == 1){
mcGrass1.visible = false;
mcMonster.removeEventListener(Event.ENTER_FRAME, TouchingGrass1);
}
It makes mcGrass1 disappear, but not the event listener. When I touch the area where it was, it still goes to the screen "math". [URL] That is the location of my .fla
View 1 Replies
Mar 1, 2009
I'm new to AS 3.0 and I don't get this fluid thing fully. Everything works fine when I want my movieclip to align to the middle of the screen but when I try to make a button (or any movieclip) always align to bottom right I can't figure out how. Here's my AS, how do I make the "ball_mc" align bottom left?
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
stage.addEventListener(Event.RESIZE, resizeListener);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
[Code] .....
Here's an example of how I want my movieclip to get placed, (like the "fullscreen" button): [URL]
View 2 Replies
May 11, 2009
I have a flash project that's implementing a simple two player game. I have added an enterFrame function to my main movie which listens for keyboard activity in order to move a cowboy gunslinger. Whenever the cowboy moves, I send a message over a socket to a server which dispatches the movement to the other connected client. This works pretty well, however, the movement messages tend to arrive in clumps which results in jumpy animation of my cowboy on my opponents screen and jumpy animation of his cowboy on my screen. To illustrate, i put a trace in my enterFrame function because I am imagining that this function will run roughly once each time my main movie renders the screen. I also put a trace statement in my function that responds to network traffic and moves the remote player's cowboy on my screen.
Here's the output:
enter frame:4
enter frame:4
enter frame:4
client movePlayer running
client movePlayer running
client movePlayer running
[Code] .....
As you can see, I'll get several messages in a row from the remote client which instruct me to move their cowboy ('client MovePlayer running') and they will all run in a row before the screen updates. I'm guessing I should be using something like updateAfterEvent but this method is only provided by Mouse, Timer, and Keyboard events.
So a few questions:
1) Can someone recommend a good approach to force a screen render each time an incoming movePlayer event arrives over the socket? It's important to note that my function for handling these events has no visibility to the original socket data event.
2) Am I right in understanding that the enterFrame function of my main movie happens once each time my movie is rendered? Is there some more accurate event to which I could attach a trace message so that I better understand the relative frequency of the render events and the socket events?
3) Does firing an updateAfterEvent call force onEnterFrame events to happen more frequently? I'm worried about destroying performance by inadvertently firing more enterFrames which would fire more socket events which would fire more enterFrames, etc., etc.
View 9 Replies
Jul 7, 2009
I'm making a game where little parcels appear and if they aren't dragged to the correct zone within 5 seconds, they disappear and the player loses points. The problem i'm having is that i'm generating the movieclip parcel objects as follows:
[Code]...
currentParcel is 1 of 3 (randomly selected) movieclip names (redParcel, yellowParcel and orangeParcel).
What I need to do is add some code to say "after a movieclip has been generated...if it is still here in 5 seconds time. It sounds simple but I can't figure it out for the life of me! I've tried setInterval with something like: timedProcess = setInterval(timeCheck, 5000);
but how can I pass the actual movieclip "handle" along with the function so that timeCheck knows which movieclip to delete?
View 4 Replies
Mar 24, 2011
I am trying to make scrolling text appear on a few screens, so that when I click on a button to go to the next frame the characters of a sentence will appear one after another as if someone is talking. This works a few times however when I go back to the first frame the following error occurs and the text no longer appears??
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at rollingtext_fla::MainTimeline/runthree()
at Function/[URL]::apply()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
This is my code basically the same for each new frame
stop()var talkinterval=setInterval(runone,60)var i:Number;
i=0 function runone() { var text:String = "Restrictive signs come in red and blue circles."; text1.appendText(text.charAt(i)); i++; };
b_next.addEventListener(MouseEvent.CLICK, nexts)function nexts(e:MouseEvent){ clearInterval(talkinterval) gotoAndStop("h")
}
View 2 Replies
May 13, 2011
I need to display a message in a flash project I'm working on. The message needs to be centered on screen, and can only be created using code.
Normally I could just put a dynamic text box on and hide it, but I can't this time.
View 2 Replies
Sep 2, 2009
Essentially I have an animation with two main movie clips - a foreground and background movie clip.I want the foreground movie clip not to scale but the background movieclip to take the full screen of the browser.I'm only using vector images
View 1 Replies
Apr 13, 2012
i want my character to walk down the screen and hit the objectWall and then a movieclip then gets added to the stage and plays but it doesnt seem to work and ii dont know why.
[Code]...
View 1 Replies
Jul 22, 2011
i found a script that unloads my external swf inside a movieclip when i click a button on my main screen. this script causes the external flash inside my moviclip to close and unload when i click the close button, which is what i want!. the only pain in the butt is it preloads the external flash when you go the flash site and i dont want that. i only want the script to close the external swf. if anyone is curious book.swf is the swf in the movieclip i am trying to close.[code]
View 1 Replies
Dec 3, 2006
I have some AS that creates a movie clip and later tries to make it go away. However, _visible isn't working as I would think. Here's a sample: I create the triangle:
[Code]...
It doesn't work, however. So, I tried trace(triangle30._visible) both before and after the second chunk of code, and it does indeed change from true to false. However, the movie clip is still visible on the screen.
View 2 Replies
Sep 17, 2009
I'm creating a quiz application using Flash CS3, but it's been such a long time since I've used ActionScript and I'm a little bit stuck.I've created an input text box in the first frame of my quiz program. A person will enter their name into this text box (which I've called "nameInput") and then click the next button to proceed through the quiz.However, when I get to the results page I cannot figure out how to get the input name to be displayed automatically in the dynamic text box (which is called "nameOutput") when the user enters the frame.
View 2 Replies
Sep 10, 2009
I'm adding captioning/subtitles to my video (FLVPlaybackCaptioning) using dfxp.xml files. Everything works great when the video plays at it's initial resolution (640 x 360). The positioning of the captions is perfect. But I've included a Full Screen button and when the video goes full screen, the captions appear but their position is off. They are higher on the screen and they actually move upward 1 or 2 lines after they initially appear. I cannot seem to control this and am not sure why it only happens in full screen mode. In the component inspector I have set autoLayout to true and to false and it does not effect the captions one way or another. I cannot seem to find any support for this.
View 3 Replies
Jun 8, 2011
I made a trivia game app that lets me enter text into input fields when the app is fullscreen on my trivia laptop. When I try running the swf on my home laptop, sometimes it lets me enter text, sometimes it doesn't. I can't remember what I did on my trivia laptop to allow text entry under full screen. Can someone please shed some light on under what conditions Flash allows it? I'm wondering if I set up the trivia laptop to run swfs using a debugging version of Flash or something, but I can't remember. As far as I can tell, it's just using the Flash player.
View 7 Replies
Oct 20, 2011
I have a class for MarqueetextField,it Displays the 6 letter only and also it doesn't display full Screen
for Example if i type"Beautiful Girl".It Displays five letter only (Beaut)
It moves five letters only.How to move full screen?
View 1 Replies
Feb 10, 2010
I recently created the following webpage: One challenge I'm having is on the About and Pricing pages. Is there a way to have my text size increase depending on how big the users screen is? Doesn't need to be exact, but if I'm on my iMac the text size is quite small when full-screen.
View 0 Replies
Sep 13, 2010
I have a .f4v on a layer using the FLVPlayback command. On top of that I have a dynamic text layer. It plays fine in a browser or at the exported resolution. When I use the command ("fullscreen", "true") or when I open the .swf and go full screen using CTRL-F the text disappears. I have removed the video and put the text on a solid background layer to determine it is the video causing this. I have also tried to convert the .f4v to a .flv and embed it in a .swf in multiple manners but the end result is always the same as the text disappearing.
View 0 Replies