I'm trying to access a text field from what I believe is called a sub-class. The text field is defined in the .fla file and the .fla file is set up to use Main.as as its document class.I got three files; scrollText.fla, Main.as and TextUtils.as.I know most of the code is working as I programmed it all in Main.as first, but when I moved the code to target the text field into its own class file I ran into error "1120: Access of undefined property" although I have declared the variable correctly and early enough to be used at this point in my code.This is the code I got so far:Main.as
Actionscript Code: package{ import flash.display.Sprite; import TextUtils; public class Main extends Sprite public function Main()
First let me say I'm relatively new to AS 3 and I've scoured the Internet looking for a simple solution to no avail.Here's my general situation:1) I have dragged a movieclip with an instance name of a_mc onto the stage.2) On the first frame of the timeline I am importing a class file and calling its constructor:
Code: import cardmaker.*; var coverMaker:CoverMaker = new CoverMaker();
I attached a movie that I am working on. I use the duplicate actionscript to put several buttons on the stage when clicked. I then want to be able to use the color picker to change the background behind the buttons. As of right now it only works on 1 button and by changing the 6 in this code for (i=1; i<6; i++) to 5, 4, 3, 2 or 1 it will only change that button. How can I get them all to change at once?
On the stage I have a movieclip called mc_back. I also have a movieclip on the stage called mc_content. Now, inside mc_content I have a bunch of code and some of it adds, or should add, an EventListener to mc_back as well as a a function that works when mc_back is pressed.
So basically, all code is written inside mc_content and some of it needs to interact with mc_back.
how to target mc_back from inside mc_content. Using stage.mc_back or root.mc_back doesn't work and Google should be my friend, but in this particular problem, it's acting more like my enemy.
I have made a navigation that is a movieclip, now within the movieclip are 6 movieclips that are the "buttons" of the navigation. This is then placed on the maintimeline as the movies navigation. When one of the "buttons" is pressed i want it to go to a specific point on one of the 6 movieclip "buttons" timeline. This is the code that I have used before on the maintime line to target a movieclip there... but never a mc within an mc. First, would I still place this code on the maintime? or within the mc that the 6 mc buttons are placed? Second how would I target the nav buttons mc's?
I've got a dynamic textfield clip which is placed twice on the stage. It also includes a button. Funny thing is, the first trace works (tracing its _y value: 0 for clip 1 and 200 for duplicate clip 2). When I press the down button of both clips however it traces undefined though it's the same line. How does onPress mess up the targetting of both clips? [code]
1. I'm loading an external swf onto my main swf. 2. Then I'm tweening an object which is separate to the loaded swf. 3. When the tween has completed I'm calling a function to make the loaded swf gotoAndPlay(2);
I made a play/pause button for this project I'm working on (basically a slideshow with a different movieclips on each frame) and I have managed to get it to target either the main timeline or a nested MC. The problem is with the code I have is that the button will only work for one MC at a time. This means I will need a separate play/pause button for each individual slide. Is there some way to make a button that globally starts and stops any MC without effecting the main timeline?
Ned proposed adding an event at the beginning of each movie clip and programming the play/pause button to work that way. My problem (after spending a lot of time with it) is that I can't get my play/pause button (a MC itself) to target the event in a separate MC.
This is my event placed on the first frame of my movie clip:
dispatchEvent(new Event("imHere"));
This is the code I have in the play/pause button that doesn't work:
I am building an ecard, and I created two swfs. The first swf is the actual ecard, with a dynamic text box that is going to display the message. The second swf is where you would actually type in the information, such as name, email, and message. Is it possible for two swfs to "talk" to each other inside an html document? Also, I am not quite sure how to send the card to someone's email. I am assuming that when you hit SEND it reads the input box with that email, but not sure how that works.
I have a main.fla which has 3 movieclips inside it. All 3 mc's have timelines that run 40 frames. The main.fla timeline has each mc instance on a frame.
mc_1 is on frame 1 mc_2 is on frame 40 mc_3 is on frame 81
as the main timeline plays the clips each one fades to the other.
I need to know how to target this scenerio
after mc_3 plays I need to have a goToAndplay (frame) set up so the animation inside mc_1 starts playing (frame 20) of mc_1.
I know how to do off a button
but there is no buttons, the action needs to happen when the playhead reaches the last frame of the main timeline in main.fla
targeting external .swf's.I am trying to load external movies to a main movie in a branched manner (i.e. root -> first movie has buttons to load second -> second movie has buttons to load third) in specific areas on the main movie.
In this simple flash im trying to get the main-button to load onto the main movie. Once it loads, a button appears and replaces the black square. When you click on it a series of other buttons appear on the side and replace the red square. Once those buttons appear, when one clicks one of them a small movie loads into the blue square and replaces it.
I am creating a drop down menu and having problems adding problems to the nested MCs. I have all the actions on the root timeline and I have a one Main_MC which holds several Sub_MC's.I have the Main MC animated fine but I can't find how to control the Sub-MC's.Here is a sample of my code and I have tried _root. and this. and show below but I can't get it to work.
//main MC Main_MC.onRollOver = over; Main_MC.onRollOut = out;[code].....
I am trying to start and stop an animation from outside of the main timeline. I have written the functions inside the movie to start and stop the animation and they work fine when called from within the movieclip but when I call them from the maim timeline I get nothing. I have checked the targeting is correct and can't think what this is
i have three MC's 1,2,3 and a button for each of them, on pressing each button it makes the appropriate MC play half way then stop at a frame with a stop action. BUT what i want is to use a if statement something like this
script is on MC1 button
tell MC1 to play (); if MC2 is at frame xx tell it to play ();
I know what the error 1061 means, but have no idea how to fix it. I've tried to correct it a million & one ways...
Code: 1061: Call to a possibly undefined method getChildByName through a reference with static type flash.display:DisplayObject.
I'm trying to target a button named 'mcTargetButton' (a SimpleButton) that's inside a movie clip called 'mcTargetParent' from a movie clip called 'mcCallFromThisClip'.
Both clips are on the main timeline. Note, I am using a document class... if I trace (this.parent) from 'mcCallFromThisClip' it prints the name of the document class.
[Code].....
how hard should it be to reach a button from a different movie clip?
Something has come up where we may need to do some geo targeting to deliver different content to a video player based on the client's (as in end-user) location. Basically, we would want to control the delivery based on country. This sounds like a huge, deep topic that I can't even begin to address. Anyone have any thoughts or experience doing this sort of thing with Flash content?
The swf may need to sit on a server we have no back-end access to, so ideally it would be a solution that doesn't require PHP or any other sort of back end...but I'm not sure if that's possible.
I have 10 MC that are generated inside of a for loop. Each MC got another MC inside of it that is already sitting on the stage and has it's own instance ame applied! After that I put them inside of a MC container, that I also add dinamicly through the addChild method! But I have one issue when I want to change the position of the child MC(one that is sitting on the stage), through targetting to it's instanceName! The code I use:
Code: var box1_mc:Box1 = new Box1(); var ball1_mc:Ball1; var balls:Array = new Array();
So i have multiple swf's that are within a stage. The main swf (index.swf) has a menu and once clicked it makes another swf to display. A common issue i'm having is that for the other swf's. I have animations which work within that swf but when i run from index they don't work.I know this is because of the targeting of the object but how do make this work?ample on 5.swf i have a button that has an action, when a mouse cursor goes over it a photo fades in and out on it, and that works when i run 5.swf
what is the syntax of targeting a scene from one swf to another? lets say i have a 2 swf file and i want to target a scene frm the second swf file named "games". tnx
I am trying to load external movies to a main movie in a branched manner (i.e. root -> first movie has buttons to load second -> second movie has buttons to load third) in specific areas on the main movie. In this simple flash im trying to get the main-button to load onto the main movie. Once it loads, a button appears and replaces the black square. When you click on it a series of other buttons appear on the side and replace the red square. Once those buttons appear, when one clicks one of them a small movie loads into the blue square and replaces it.
I have a small problem with dynamic targeting inside a loop. Shortly, I have some buttons which I add listeners to in a loop. loop works fine. I got everything to work, but the second line in it gives this error : TypeError: Error #1034: Type Coercion failed: cannot convert []@d4abe81 to Function.[code]Can anyone help me with the correct syntax for the second line ?
I have a text input field. When I press on it I'd like something to happen. But it doesn't seem like I can target the input field like this.
myTextInputFieldName.onPress = function { do something }
I tried putting it inside another movieclip (which I can target), but then the text input cursor goes away and I can no longer access the input text box. I know there is probably a simple solution but I can't figure it out.
The site has 6 pages: home, contents, contact, about, showreel, corporate. I have a panoramic photograph as a background across all my pages. When a button,such as contact, is clicked the timeline is enabled and scrolls across the panoramic to the 'contact' area of the photograph.I have a few questions relating to how I can achieve this. 1.) On my actions layer I have this code on frame one: stop(); enter_site_btn.addEventListener(MouseEvent.CLICK, buttonCLicked); function buttonClicked (event:MouseEvent):void { play(); } So when you mouseClick the timeline plays and goes to the next stop point on the timeline which is the contents section. On the contents page are the buttons which lead to the other sections. So far I have this code: stop(); about.btn.addEventListener (MouseEvent.CLICK,buttonCLicked) corporate.btn.addEventListener
Each of the buttons work, but I want the timeline to play and go to the page which corresponds to the button which is clicked, not just to play the timeline until the next stop point. Is there a code which would enable the timeline to play and go to the correct section, and not just roll without a target? 2.) I also want to be able to write a code which enables the timeline to move to any section in the same amount of time. What I mean by this is that if it takes 2 seconds (48 frames) to go from the first section to the second section, I also want it to take 2 seconds to go from the second section to the sixth section (240 frames)