ActionScript 3.0 :: Cut And Pasted Code Not Working?
Feb 11, 2010
I created a drag and drop quiz following an online tutorial. It worked fine. Then I made a different one. I cut and pasted the code from the working file into the new one and changed the names of the movie clip instances. When exported (control +enter) I can pick up the MCs I want but I can't drop them; they just stay stuck to the cursor until I click on another MC. I have gone through the code and I can't find anything wrong. It just doesn't work I'm stumped. Here are the working and not working versions:
var counter:Number = 0;
var startX:Number;
var startY:Number;
[code].....
View 11 Replies
Similar Posts:
Jun 9, 2011
I've literally been staring at this for 7 hours. I'm missing something.I have two movie clips on the stage. The instance name of the first is puzzleAK. The instance name of the second is pieceAK.The first is linked to a custom class called GeoPuzzle. The second is linked to a custom class called GeoPiece.The code compiles but throws an error (as explained).The code in the main timeline:
puzzleAK.fullName = "Alaska";puzzleAK.abbrev = "AK";puzzleAK.isLocked = false;trace ("made it through puzzle definitions: " + puzzleAK.fullName + " " + puzzleAK.abbrev + " " + puzzleAK.isLocked);
[code].....
View 7 Replies
Dec 27, 2010
Is there a way to make code on the timeline and code in a separate AS file communicate with each other?I have two buttons, a yes button and a no button.I have a confirm box which is a movie clip. In the movie clip I have the two buttons on it and code so that every time one of the buttons is clicked it runs a function.I have the rest of my code for the movie (so the code to make the confirm box appear) on a separate AS file.Is there a way I can define the functions on the movie clip and run the functions with the separate AS file?
View 7 Replies
Oct 31, 2009
How can I know if the user pasted or pressed Ctrl+V? I found a PASTE event, but I can't figure out to which object i should add a listener too.
View 3 Replies
Jul 24, 2010
I have two files one is called tween_start.fla and the other is called tween_end.fla I am trying to create a motion tween where the animation begins at tween_start.fla and ends at tween_end.fla Each file consists of 7 shapes (it's a tangram if you're curious). At frame 10 of the tween_start.fla timeline I right-click on each layer and do Insert Blank Keyframe. Then I go to tween_end.fla click on a shape and do Modify>Convert to Symbol. Then I go back to the timeline for tween_start.fla, right-click on frame 10 and do Paste Frames or Insert Keyframe. If I do Paste Frames with all of the symbols I've created in tween_end.fla then the shapes end up stacked on top of each other. If I do Insert Keyframe it doesn't insert the symbol I've just created, instead it just keeps the same shapes that were at the first frame of tweet_start.fla. So how do I insert the symbols from tween_end.fla into the tenth frame of tweet_start.fla and then execute a motion tween between the frames?
View 3 Replies
Dec 27, 2010
I'm attempting to parse newlines from pasted text from the clipboard into a single-lined TextField. I'd like to replace the newlines with ' ' (or any other delimiter) in the text field and have it submit text with newlines (' ' delimiter would suffice, as that's automatically parsed within my message box already).
Is there any method I could use to go about this?
View 1 Replies
Apr 4, 2011
I'm using Flex to generate text that will be copied to the clipboard so a user can paste a grid into Excel. For instance it might generate the following text which can be copied into Excel:
<html><body><table><thead><tr>
<th>COL1</th>
<th>COL2</th>
<th>COL3</th>
</tr></thead><tbody><tr>
[Code] .....
I have some columns that contain numbers that should be considered text, for instance they have leading zeros that shouldn't be removed. How do I set the formatting for these columns so the leading zeros don't get removed in Excel?
View 1 Replies
Jul 24, 2010
I have two files one is called tween_start.fla and the other is called tween_end.fla I am trying to create a motion tween where the animation begins at tween_start.fla and ends at tween_end.fla Each file consists of 7 shapes (it's a tangram if you're curious). At frame 10 of the tween_start.fla timeline I right-click on each layer and do Insert Blank Keyframe. Then I go to tween_end.fla click on a shape and do Modify>Convert to Symbol. Then I go back to the timeline for tween_start.fla, right-click on frame 10 and do Paste Frames or Insert Keyframe. If I do Paste Frames with all of the symbols I've created in tween_end.fla then the shapes end up stacked on top of each other. If I do Insert Keyframe it doesn't insert the symbol I've just created, instead it just keeps the same shapes that were at the first frame of tweet_start.fla. So how do I insert the symbols from tween_end.fla into the tenth frame of tweet_start.fla and then execute a motion tween between the frames?
View 3 Replies
Sep 15, 2011
Why is that whenever I cut a frame, clear the frames in a timeline, paste it in new frame then test the clip, the whole thing starts to act funny?I just don't understand why that happens - it's supposed to run smoothly though it's on a new frame, right? Is there a way to maintain the movie clip when tested though some frames were cut then pasted on a new frame?
View 3 Replies
May 5, 2011
I'm trying to remove all line breaks from the text that is pasted into the Spark TextArea.
I have:
<s:TextArea id="inputSearchQuery"
width="100%" height="22"
[code].....
View 1 Replies
Oct 14, 2011
I have an Actionscript coded flash file which run perfectly without any error. I am not getting why it shows an error after i do insert a scene before or a frame before the current frames;
[Code]...
View 1 Replies
Nov 27, 2009
I have searched all of the engines to find out why my SharedObject code is not working. It works when I publish from flash but not when live? I have this code in the first frame and the movie starts on the second. I only want the user to have to view the swf every other time they land on the page containing the movie. I am using AS2.
var replay = SharedObject.getLocal("save");
if (replay.data.name == undefined){
gotoAndPlay(2);
[code]....
View 1 Replies
Sep 22, 2004
on (press) {
_root.mySlider.mySound.stop();
if (_root.mySlider.mySound.stop()) {
_root.dl = "Sound is Stopped...";
[code]....
this is on the stop_btn to stop music on playing and also show the text "Sound is Stopped" and as soon as the user click on play button the text is "playing"but this code seems to be not working?
View 5 Replies
Nov 22, 2009
I can place the following code on a movieclip:
PHP Code:
onClipEvent(load) {
gravity = 0.2;
yspeed = 0;
[code]....
And it'll work fine, however if I place it like this on a frame in the movieclip:
PHP Code:
this.onLoad = function() {
gravity = 0.2;
yspeed = 0;
[code]....
It doesn't work
View 6 Replies
Jun 3, 2010
I have a preloader.swf file that contains a preloader animation. I'm using the following actionscript code to make it work:
Code:
var loader_mc:MovieClip = new Preloader();
var loader:Loader = new Loader();
[code].....
View 2 Replies
Jan 2, 2011
I am trying to put together a little accordion animation for a site. I am using code from this site:
[URL]
I only need 3 panels instead of 4 so I took the code and changed it to this:
package
{
/**
* Accordion Menu
[code]...
You would think that SOMETHING would happen now. Even if its just a strange movement of some kind. But nothing does happen. Not even an error message of any sort. I started messing with that X and Y value but nadda thing. All of my movie clips are named correctly. card1, card2 and card3. Maybe it has something to do with the packages? I have never used components before like tweenlite. I took the files and just placed them in the folder with my flash movie.
View 3 Replies
Sep 2, 2009
this is probably a very simple mistake made by many beginners. Basically, I have a preloader loading an external swf. The external swf is an image sequence. I wrote actionscript so you can scrub through the image sequence using the keyboard arrows. This works by itself but does not work when preloaded.
[Code]...
View 8 Replies
Aug 29, 2010
Okay, so I want it so when I press the button the cheese ON TOP of the bird appears/disappears. It works with the cheese outside of the bird movieclip but not on the cheese inside the movieclip.
View 6 Replies
Aug 27, 2009
I have this code creates a function at runtime (yes, this IS needed):
PHP Code:
var createdFunction = function():void {
trace("Function Created");
}
createdFunction();
Putting in in to the actions panel in Flash CS4 and compiling works fine, tracing the message "Function Created"...However, the Flex compiler gives me this
Quote:
Error: Call to a possibly undefined method createdFunction.
createdFunction();
Build halted with errors (fcsh).
View 2 Replies
Oct 9, 2009
I have had this problem for a long time and have not been able to fix it. I am using ActionScript 1, although if you can help me using AS2 I should be able to change it. I have a static movie clip with no code referring to it called "ship". Its center point is 275, 324.9. I have a series of planets coming down from the top of the screen and I need to check whether you "died" or not. The planets movie clips are contained inside blank movie clips that are there so thre registration point does not change. I was using the code
Code:
if(this.hitTest(275, 324.9, true)){
gotoAndPlay("gameover");
}
View 3 Replies
Feb 8, 2011
Not sure if the problem is that javascript is not allowed in navigateToURL(), but the following code does not work as intended:
var req:URLRequest = new URLRequest("javascript:resizeTo(1024,768)"); navigateToURL(req, "_self");
Is there an easy alternative? Perhaps a syntax change?
View 8 Replies
Aug 28, 2011
I am using the following code snippet: but this error occurs Line 6 1061: Call to a possibly undefined method play through a reference with static type flash.media:Video. img1.addEventListener(MouseEvent.CLICK, fl_ClickToPlayVideo);
function fl_ClickToPlayVideo(event:MouseEvent):void
{
video_1.play(); //the error is referring to this line here
}
Would i have to add something there?
View 7 Replies
Oct 17, 2010
code hinting doesn't seem to work for my Flash CS5. I already tried increasing the code hint cache size, but it still doesn't do anything.
View 3 Replies
Feb 4, 2009
Code:
import flash.display.*;
import flash.events.*;
import flash.text.*;
[code]....
My Problem is getting a preloader to work In AS3 code above, loading in media_player.swf from the same directory.
View 2 Replies
Jan 12, 2009
Now I'm working on a Website which contains a XML Carousel Gallery, with the coding below.Now this all happens on the homepage. I would like to stop the xml on other frames though. Is there any coding I can use on my Buttons, to stop the XML working while going to another frame?
stop();
var folder:String = "thumbnails/";// a folder for thumbnail files + an XML file
var total:Number;
var radiusX:Number =180;
var radiusY:Number = 10;
[code]...
View 2 Replies
May 15, 2009
The code works fine, but every time I click Auto Format it changes the code so it doesn't work anymore, giving me all kinds of errors. I perceive this as something imperfect in the code and potentially preventing it from working as efficiently.
import caurina.transitions.Tweener;
import fl.transitions.Tween;
import fl.transitions.easing.*;[code]...
View 1 Replies
Feb 7, 2002
i am still having problems with the quiz i am doing. You sent me the code:-
if (check1 == true && pa1 == answer){
"well done you has chosen the right answer";
} else {[code]......
I think there is possibly something wrong with my checkboxes, as this is the only part (check1 == true) which isn't working at all in the code.The checkboxes and the buttons are all within the movie clip, have also tried them outside it aswell.
View 8 Replies
Jan 28, 2009
[code]It works fine when I press the button but not when I press the enter key.Just to set the context I want users to be able to use enter to enter an answer into a grid before moving on to the next cell. My cells are all labelled A1, A2 etc so that I didn't get confused. As I am and will always be a newbie I couldn't figure out a function to do what I wanted so came up with what is probably a long winded way around: store the textfield instance name in an array and then call the item in the array in conjunction with setFocus - like I say it works when I click the button (which I intend to hide off screen).
View 10 Replies
Dec 29, 2009
I really hate when you read a tutorial from some "expert" and what it tells you to do is wrong. I was doing a tutorial for a XML slide show, and the last line of code doesn't work quite right:
[Code]....
For some reason that only sends the my_playback_counter to 1. And it just sits there twitching. So when I tried to change the tutorial code to:
[Code]....
View 3 Replies
Aug 22, 2010
I'm trying to check through an array to see if any of my movie clips are currently on frame 15, before taking giant leaps I was trying to just get it to work with one var in the array before all of them, for some reason this code is not working, the trace is not coming up.
Code:
stop();
var anybtn:Array = [btn1_mc, btn2_mc];
trace(anybtn[1]);
btn1.onPress = function(){
if(anybtn[1]._currentframe == 15){
trace ("Array Check Working"); .....
If someone would like to go a step further and show me how to check through all movie clips. There will be many more than btn1_mc and btn2_mc so I will definitely need to use an array.
View 4 Replies