Movieclip Issue
hi ppl,
I am hoping someone might be able to help me? I am really having some trouble with a movie clip in flash.
The idea is bubbles which are animation with a simple motion tween to loop up the page. Inside the movieclip is a button, which I wanted to add the effect of moving bubbles up the page and with a button state burst the bubble with a sound sample to play. However this doesnt work right because the movieclip is moving at the same time we want to click on it. Can anyone help me I am so stuck.
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 04-12-2005, 02:04 PM
View Complete Forum Thread with Replies
Sponsored Links:
Major Issue: MovieClip Inside Movieclip Will Not Have MouseEvents?
Hey guys, I got this empty MovieClip i add to the stage called 'container'. In container, I also dymaically add warrior(), warrior2(), and warrior3(). Now Im trying to add my rollover state for warrior, however, it never works?
When I place the warrors inside of a container in design time and then attach the code and place it on the stage, it works? Any Ideas?
public function addHitState(container:MovieClip, linkage_name:String, id_name:String):void{
var class_definition:Class = getDefinitionByName(linkage_name) as Class;
var added_clipisplayObject = new class_definition();
added_clip.name = id_name;
container.addChild(added_clip);
added_clip.x = 1151.2;
added_clip.y = 407.8;
added_clip.buttonMode = true;
added_clip.addEventListener(MouseEvent.ROLL_OVER, rollOverFunction);
};
private function rollOverFunction(event:MouseEvent):void{
trace("@");
};
View Replies !
View Related
Movieclip Within A Movieclip Button Issue
The 2nd box is the one with the movieclip in it. When you rollover the box (keep in mind that your cursor has to remain on the box in order for the entire movie to play), it animates. When the box animation is complete the second movieclip plays. it plays the first logo, but the next and previous buttons don't work. How do i get the next and previous buttons to work? The fla is below
www.geocities.com/demetriusmcclain/services.fla
View Replies !
View Related
Movieclip On Top Issue
Hi everybody,
here it comes:
I tried to create two MCs, both with there own tween. while you are "rollover" on one of the clips the tween is playing.
-------------------------------
on (rollOver) {
aktiv = true;
}
on (rollOut, dragOut) {
aktiv = false;
}
-------------------------------
when u leave the MC it reverse it self
-------------------------------
onClipEvent (enterFrame) {
if (aktiv) {
nextFrame();
} else {
prevFrame();
}
}
--------------------------------
The first MC is called: "mc"
The secound one "mc3"
And here is my prob:
MC3 works perfectly. While mc3 is expandig it covers "MC".
The other way round does not work right: While "MC is expanding" it DOES NOT cover "MC3".
Does anyone know how to slove this problem? More on a solution would be fine which also works for more than two MCs!
I have embedded the FLA if that helps somehow!
Thanks a lot!
phoenix
View Replies !
View Related
Movieclip Issue
hi ppl,
I am hoping someone might be able to help me? I am really having some trouble with a movie clip in flash.
The idea is bubbles which are animation with a simple motion tween to loop up the page. Inside the movieclip is a button, which I wanted to add the effect of moving bubbles up the page and with a button state burst the bubble with a sound sample to play. However this doesnt work right because the movieclip is moving at the same time we want to click on it. Can anyone help me I am so stuck.
View Replies !
View Related
Stop MovieClip Issue
In my code I am trying to stop my main timeline and the timeline of the movieClip. But I am having trouble getting the code to work.
Code:
on (release) {
//trace("test");
//trace the currentFrame of the mainmovie
trace("currentframe"+this._currentFrame);
_root.gotoAndStop(this._currentframe);
_root.VSound.stop();
for (var i in _root) {
if (typeof (_root[i]) == "movieclip") {
//trace currentFrame of movieclip
trace((_root[i])._currentframe);
//((_root[i]).gotoAndStop(_currentframe))
((_root[i])._currentframe).stop;
}
}
}
View Replies !
View Related
Movieclip Link Issue
http://www.yousendit.com/transfer.ph...F6DA0B03F31248
Whats up with my simple slideshow?
I created 3 movieclips with animation. (ad1_mc,ad2_mc,ad4_mc)...and I gave 3 functions...1 and 2 are working but not the 3rd one...to test this...I created 3 movieclips without animation (symbol1,symbol2,symbol3) and tested it ...it works fine...Please someone check it out....Thanks
View Replies !
View Related
Movieclip Link Issue
movieclip link issue
--------------------------------------------------------------------------------
http://www.yousendit.com/transfer.p...6F6DA0B03F31248
Whats up with my simple slideshow?
I created 3 movieclips with animation. (ad1_mc,ad2_mc,ad4_mc)...and I gave 3 functions...1 and 2 are working but not the 3rd one...to test this...I created 3 movieclips without animation (symbol1,symbol2,symbol3) and tested it ...it works fine...Please someone check it out....Thanks
View Replies !
View Related
Odd Issue With A MovieClip Button
I have a MovieClip button problem that I absolutely cannot figure out.
I'm working in Flash 8 Pro, AS 2.0. The clip, "btn_mc" is nested 3 deep (_root.Node1.Panorama1.btn_mc). I have a script on the instance that reads
thusly:
[as]
onClipEvent(mouseUp){
_root.N1_N2();
trace("exit1");
}
[/as
The function "N1_N2" resides on the first frame of the root timeline. At first glance, the button seems to work fine, but the trace command outputs the string "exit1" twice. Additionally, it appears that the button is not what I'm clicking. I can click anywhere in the movie, and N1_N2 is called.
What's worse, I need to place more than one of these buttons into the movie. Once I do that, things get really screwy. Say I put in a second button that calls function N1_N6 and outputs "exit2." Once a mouseUp occurs on either button (or the parent movieclip, for some ungodly reason), I get an N1_N6 function call and trace output of "exit 2, exit1." I'm stuck. What am I doing wrong? Thanks in advance for any help!
View Replies !
View Related
MovieClip.prototype Issue
Hi there,
First of all, if you really want to help me, please don't:
1. question my approach (taken out of context to focus on the problem)
2. suggest a workaround
My problem: I've got the following code:
code: MovieClip.prototype.sequence = function() {
_root["Button"+i].onRelease = function() {
this.gotoAndStop("active");
};
};
for (i=1; i<=4; i++) {
_root["Button"+i].i = i;
_root["Button"+i].sequence();
}
This code works fine. However, for some reasons which I do not wish to elaborate on, I need to replace this code with code: MovieClip.prototype.sequence = function() {
_root["Button"+i].onRelease = function() {
_root["Button"+i].gotoAndStop("active");
};
};
for (i=1; i<=4; i++) {
_root["Button"+i].i = i;
_root["Button"+i].sequence();
}
since I need the absolute path. Only exchanged the highlighted area. Now it doesn't work any more; - question: why not?
What can I do to make it work? In case of confusion, view attached file.
Help appreciated.
View Replies !
View Related
Issue Extending Movieclip
Hello,
So I have a class Category which extends MovieClip. (here's my .fla)
I'm designing a dynamic flash menu, and as such each category will have a category name. Everything works fine and dandy in my code, i create a Category and feed it all the attributes I need, until I run the metthod attachMovie( ... ) . Right after I run attachMovie( ... ) , suddenly everything from my Category class is undefined. (Below is my code in the navigation, sorry for the length.. but may as well be complete):
Code:
/* Flash Navigation Actionscript
*
* This sets up a sliding style flash navigation for the Lazzarus website.
* @author:Brandon Visser
* @date:August 2006
* @ver:1.0*/
var categories:Array;// main category object
categories=new Array();
/* Step 1: Read category logic in from database or flat file */
// ToDo: For loop to read data in from database/flat file (however you're doing it)
// category logic
categories[0]=new Category("Category 1", 1);
categories[0].addSubCategory("sub 1, 1", 0);
categories[0].addSubCategory("sub 1, 2", 1);
categories[0].addSubCategory("sub 1, 3", 2);
categories[1]=new Category("Category 2", 1);
categories[1].addSubCategory("sub 2, 1", 0);
categories[1].addSubCategory("sub 2, 2", 1);
categories[1].addSubCategory("sub 2, 3", 2);
categories[2]=new Category("Category 3", 1);
categories[2].addSubCategory("sub 3, 1", 0);
categories[2].addSubCategory("sub 3, 2", 1);
categories[2].addSubCategory("sub 3, 3", 2);
// end category logic
/* Step 2: Position/Place categories */
var ypos:Number; //default Y position to offset
ypos=10;
var buttons:Array = new Array();
var tmp:MovieClip;
var id:String;
var cn:String;
for (i=0; i<categories.length; i++) {
cn=categories[i].getCatName();
id="category"+(i+1);
trace(categories[i].getSubArray().length);
Object.registerClass("categoryButton", Category);
categories[i]=this.attachMovie("categoryButton", id, i, {_x:2, _y:ypos+i*25});
trace(categories[i].getSubArray()[2]);
categories[i].categoryname.text=cn;
categories[i].onPress=function() {
var subs:Array;
trace (this.isCatOpen());
trace(this.getSubArray().length);
}
}
I'm at a loss, and have literally spent days spinning my wheels without getting anywhere. If anyone can offer insight into what it is I'm doing wrong, well then they would be king(/queen?).
I'm lovin actionscript and flash, but I seem to keep hitting these roadblocks
Thanks,
- Brandon
View Replies !
View Related
Nested MovieClip Issue
This should be an easy one for you experts out there!
All i want to do is to have the parent movieclip to have an image within it
as well as having a nested movieclip with an image within itself as well.
The problem is I only get the image within the child movieclip to show!
the parent's image does not show up!
Here is the code that I have been fiddling with:
content.createEmptyMovieClip("mcHolder", content.getNextHighestDepth());
content.mcHolder.loadMovie("frame.swf");
content.mcHolder.createEmptyMovieClip("mcJPEG",1);
content.mcHolder.mcJPEG.loadMovie("MCM/thumb.swf");
...any suggestions?...please? (only thumb.swf shows)
View Replies !
View Related
An Issue With A Movieclip Button
I have recently found a tutorial on how to make an animated button entirly through the use of a movie clip.
The tutorial is great up to the point where it does not explain how to apply a hit space and how to link the button to a later point in the main timeline.
The Button works pefectly. the animation finishes even when the mouse is pulled away. On a lables layer I have labled frames _over and _out.
For the sake of practice all i want to do is get my single button to jump to a later point on the timeline where i have changed the background colour.
This is the action script applied to the button. everything between double inverted comers I have added after to try and make it work.
this.button_mc.onRollOver = function() {
button_mc.gotoAndPlay("_over");
}
this.button_mc.onRollOut = function() {
button_mc.gotoAndPlay("_out");
}
""this.button_mc.onPress = function() {
button_mc.gotoAndPlay(frame, 96);
}""
(made with AS2 in ACS3)
If im not explaining this properly could you advise me in what information i am missing.
Thanks for any advice given
Oli Lyndale
View Replies !
View Related
Movieclip Resizing Issue.
Hey everyone
I've got a minimap which i'm creating dynamically. It fits 3 by 3 "rooms", and i'd like to make it expandable so it can fit more.
So far i've got it so that it goes from it's 90 by 90 size to being about 700 by about 500. It scales the inner parts of it so it appears to just increase how much you're seeing. Everything works fine. Except, for some reason, the map changes size at random, almost.
ActionScript Code:
} else {
_root.Map._x = 10;
_root.Map._height = 545;
_root.Map._width = 768;
_root.Map.player._xscale = _root.Map.Map._xscale=(90/_root.Map._width)*100;
_root.Map.player._yscale = _root.Map.Map._yscale=(90/_root.Map._height)*100;
_root.Map.Map._x = -30*_root.x*(_root.Map.Map._xscale/100)+45;
_root.Map.Map._y = 30*_root.y*(_root.Map.Map._yscale/100)+45;
_root.Map.state = 1;
}
As you can see, i've hard-coded in the height and width of it, and as far as i'm aware that should make it be a certain size. However as i said, when the _root.x value is other than 0, the map seems to shrink in a little.
_root.Map is the map as a whole, which contains a mask, a line, and two other movieclips, one also called Map and one called player. _root.Map.Map is what actually has the rooms and dynamic content in it. I've scaled this so that it appears to be the same size as it was previously. The x and y co-ordinates of the _root.Map.Map are set to be in the middle of _root.Map in the second last two lines, and that is the only time where i can see _root.x and _root.y mentioned, and even if i comment those lines out it still changes the overall size.
I can't see why this'd happen. I can post a .fla too if people want to have a look.
View Replies !
View Related
Movieclip Onrollover Issue
I created a flash piece for a menu based videos...I created the menu with movieclips.Here the problem comes. When I click on it, I want it to act as a button, So, I did some tricks. by using toggle. Please see the flash swf for following explanation...Since I am duplicating the movie clips, when I click on it, It stays onRelease event, Even though the other button has been clicked...how to trigger it...
http://www.geocities.com/tjsubha/index.html
Thanks in advance
View Replies !
View Related
MovieClip.getNextHighestDepth Issue
I've got MCs in the library that I am attaching at runtime onRelease of a button. There are several buttons and that many clips to be attached. The clips attach fine but the "2nd' clip deletes the first clip and I want the "2nd" clip to attach on top of the first. (fade in over the first).
Thanks in advance!
Attach Code
this.createEmptyMovieClip("container",1);
container._y = 106;
MBenzThumbs.MBenzJpgs.btn1.onRelease = function() {
container.attachMovie("c300","c300",container.getNextHighestDepth());
}
MBenzThumbs.MBenzJpgs.btn2.onRelease = function() {
container.attachMovie("cl550","cl550",container.getNextHighestDepth());
}
View Replies !
View Related
Masking/movieclip Issue
Issue: I have a image that is masked to only reveal square piece of the image. This image in turn is within a movieclip. the image that I am masking cannot be sliced. The movieclip that the image is in is part of a hitTest action. What is happening is the whole image within the movieclip is being detected with the hitTest of the movieclip. Is there a way to have only the masked square area of the image withing the movieclip be the hitarea instead of the whole image being part of the hitarea?
View Replies !
View Related
MovieClip Navigation Issue
Greetings All! All comments welcome in resolving this issue. I wish I could post the swf, however, it is a project for work so I will try and explain as best as possible.
I'm working on an online demo. My intro swf has 3 frames that contain movie clips each movieclip in their own seperate layer (layers 1, 3, 5).
Now layers 2 and 4 are my "Next" buttons.
Here's the problem: when I click the "Next" button to play the next movieclip (in frame 2), the navigation continues to the next frame (frame 2), but does not stop. It goes through all 5 frames of the main swf. So basically you get a quick view of the correct movieclip, but instead of playing the movieclip in frame 2, it flashes frame 2, then the movie clip in frame 3, and so on.
I've used the gotoandStop code, but it doesn't stop. Oh and forget about clicking the "Back" button. The whole thing just goes berzerk! haha
Please, any assistance would be greatly appreciated! If you require more clarification please refer to the online banking demo of Bank of America. I am trying to replicate their navigation with "Next", "Back", and "Pause" buttons.
I'm trying to keep this as one swf file with several scenes. This way, I will only need one preloader instead of several preloaders with the loading of every external swf file.
Thank you all in advance!
n3wbi3
View Replies !
View Related
Movieclip Onrollover Issue
I created a flash piece for a menu based videos...I created the menu with movieclips.Here the problem comes. When I click on it, I want it to act as a button, So, I did some tricks. by using toggle. Please see the flash swf for following explanation...Since I am duplicating the movie clips, when I click on it, It stays onRelease event, Even though the other button has been clicked...how to trigger it...
http://www.geocities.com/tjsubha/index.html
Thanks in advance
View Replies !
View Related
Movieclip Rollout Issue...
im sure its been post here before(or somewhere). I'm making my movieclip rollovers and everything works just fine, BUT if you rollout TOO FAST the clip stays and flash doesn't recognize the rollout/over...
how is this solved?
View Replies !
View Related
Strange Movieclip Issue
Im not sure if this is a noted issue issue or not but Ive got some strange behaviour going on and I could do with some guidance on a way around it.
My game consists of a grid of movieclips, created dynamically. within these movieclips is another movieclip of an explosion.
The explosion movieclip stops at the first frame (blank frame), and the animation starts at from lable "on", once it gets to the end, it jumps to "off" - the first frame.
Now, if I gotoAndPlay("on"); it works, if I gotoAndStop("off"); it works.
However if I gotoAndPlay("on") before the animation has ended (ie: when I want the animation to restart), it carries on regardless and then loops for a few frames before stopping.
If I call stop() before the gotoAndPlay call its the same, but if I call gotoAndStop("off") right before I call gotoAndPlay("on") the animation will loop constantly and no more actionscript on that movie clip will be executed (until another call to gotoAndStop("off"); )
Does anyone have any idea how to fix this?
: D
View Replies !
View Related
Variable/Movieclip Issue...
Hey dudes.. just wondering if anyone can shed a bit of light on this for me...
basically i am tryin to move logos around on screen using actionscript..i have lots of them that i want to run through so i'm using variables.. i have an array called logos[0] that the images are coming from and i have MovieClip 6 holders on the stage called holder1 - 6...i've adapted this bit of code i got off a forum to get this workin...
var boxcounter:Number = new Number(1);
var currentlogo:String =new String ("holder"+boxcounter);
var startX = 646;
var endX = 65;
var speed = 10;
currentlogo._x = startX;
function moveMe(targ){
targ._x+=(_root.endX-targ._x)/_root.speed
}
onEnterFrame = function(){
setInterval(moveMe,30,_root.currentlogo)
}
i think i know what the problem is but i just don't know how to fix it... the error is showing in this line
currentlogo._x = startX;
where it says
There is no property with the name '_x'.
currentlogo._x = startX;
what i think is happening is that currentlogo isn't a movieClip its a variable so it doesn't have the property x.. am i right in thinking this?? i've traced currentlogo and i get holder1 which is the name of the movie clip i'm tryin to target.. if i put holder1 into
currentlogo._x = startX; like this..
holder1._x=startX;
it works fine...
is there a different syntax i've to use or something? anyone know? any help would be greatly appreciated!
thanks a mill
leapin
View Replies !
View Related
Timeline Movieclip Issue
So i have a animation on a timeline, and a movie in a movieclip.
What i want to happen is the animation plays on the timeline, then when you click the play button to the movie, the movie plays and the timeline stops where its at and pauses.. then when you pause or stop the movie, the timeline starts from where it left off. if there are any ways to go about this.. maybe having both of them on the timeline or something.. im up for it.. any help would be appreciated.
thanks
http://www.anthonybruno.info/kirupa/index_video.fla
View Replies !
View Related
Linkage Movieclip Issue
Hi all,
I have one movieclip in (my.fla) and I'm trying to use the linkage to give a classname of "bgMC" to it. Unlike as2, there's no more identifier.
The compiler gives me that error:
Error #1009: Cannot access a property or method of a null object reference.
while running debug in flash cs3, it stops at line:
this.backgroundMC.width = stage.stageWidth;
It can't recognize the linkage that I have declared.
Does anyone know how to fix that?
The idea here is basically I want to reuse this class that I've made on others projects.
my main class:
Code:
package src
{
import manageBG.bgFullScreen;
private var bgScreen:bgFullScreen;
private var test:MovieClip = new bgMC();
public class main extends Sprite
{
public function main():void
{
this.bgScreen = new bgFullScreen(test);
}
}
}
bgFullScreen class:
Code:
package manageBG
{
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import flash.display.MovieClip;
public class bgFullScreen extends Sprite
{
private var backgroundMC:MovieClip;
public function bgFullScreen(mc:MovieClip)
{
this.backgroundMC = new MovieClip();
this.backgroundMC = mc;
this.positionBG();
this.initStage();
}
private function initStage():void
{
stage.addEventListener(Event.RESIZE, handleBG);
}
private function handleBG(evt:Event):void
{
this.positionBG();
}
private function positionBG():void
{
this.backgroundMC.x = 0;
this.backgroundMC.y = 0;
this.backgroundMC.width = stage.stageWidth;
this.backgroundMC.height = stage.stageHeight;
addChild(backgroundMC);
}
}
}
View Replies !
View Related
CHILD MOVIECLIP ISSUE Pls Help
Hi All
Need urgent help! Thx very much in advance.
Issue/Q.: Is there a way to reset a Child MC so that it loads as it was the first time?
I have a MC (Main) which has various buttons(of movieclip type). Each of these buttons will load a Child MC using addChild(). The Child MC contains various slides which i flip thru using its own buttons (movieclip type).Working fine when loading and unloading these Child Mc's in the Main MC using addChild and removeChild.
PROBLEM SCENARIO:
Clicked button 1 on Main MC to load child 1 using addchild.
Flipped thru the slides on this child1.
clicked on button 2 on the Main MC- loads child 2 (working fine)
But if i go back and click button1 to re-load the child1, child1 loads fine but displays the last slide that i viewed in it. This is happening bcos the AS in the Child MC is doing its job by displaying the slides.
But, is there any way to reset the child MC. I thought that when i am unloading the Child MC and then reloading it, it would start afresh! Pls pls advise....
Thanks again for any of ur advice/help. really appreciate any insight into this issue....
View Replies !
View Related
Masking/movieclip Issue
Issue: I have a image that is masked to only reveal square piece of the image. This image in turn is within a movieclip. the image that I am masking cannot be sliced. The movieclip that the image is in is part of a hitTest action. What is happening is the whole image within the movieclip is being detected with the hitTest of the movieclip. Is there a way to have only the masked square area of the image withing the movieclip be the hitarea instead of the whole image being part of the hitarea?
View Replies !
View Related
MovieClip Navigation Issue
Greetings All! All comments welcome in resolving this issue. I wish I could post the swf, however, it is a project for work so I will try and explain as best as possible.
I'm working on an online demo. My intro swf has 3 frames that contain movie clips each movieclip in their own seperate layer (layers 1, 3, 5).
Now layers 2 and 4 are my "Next" buttons.
Here's the problem: when I click the "Next" button to play the next movieclip (in frame 2), the navigation continues to the next frame (frame 2), but does not stop. It goes through all 5 frames of the main swf. So basically you get a quick view of the correct movieclip, but instead of playing the movieclip in frame 2, it flashes frame 2, then the movie clip in frame 3, and so on.
I've used the gotoandStop code, but it doesn't stop. Oh and forget about clicking the "Back" button. The whole thing just goes berzerk! haha
Please, any assistance would be greatly appreciated! If you require more clarification please refer to the online banking demo of Bank of America. I am trying to replicate their navigation with "Next", "Back", and "Pause" buttons.
I'm trying to keep this as one swf file with several scenes. This way, I will only need one preloader instead of several preloaders with the loading of every external swf file.
Thank you all in advance!
n3wbi3
View Replies !
View Related
Movieclip Button Issue
I made some movieclips into buttons that will basically link to another page. Inside this button it has text and all. But the problem I have is when I go to the edge of the buttons they begin to animate extremely fast back and forth from the over state and the up state. What should I do to cure this issue?
View Replies !
View Related
Linkage Movieclip Issue
I have one movieclip in (my.fla) and I'm trying to use the linkage to give a classname of "bgMC" to it.
Unlike as2, there's no more identifier.
The compiler gives me that error:
Error #1009: Cannot access a property or method of a null object reference.
while running debug in flash cs3, it stops at line:
this.backgroundMC.width = stage.stageWidth;
Does anyone know how to fix that?
So, my main.as looks like:
Code:
package src
{
import manageBG.bgFullScreen;
private var bgScreen:bgFullScreen;
private var test:MovieClip = new bgMC();
public class main extends Sprite
{
public function main():void
{
this.bgScreen = new bgFullScreen(test);
}
}
}
I have another class to manage my background:
Code:
package manageBG
{
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import flash.display.MovieClip;
public class bgFullScreen extends Sprite
{
private var backgroundMC:MovieClip;
public function bgFullScreen(mc:MovieClip)
{
this.backgroundMC = new MovieClip();
this.backgroundMC = mc;
this.positionBG();
this.initStage();
}
private function initStage():void
{
stage.addEventListener(Event.RESIZE, handleBG);
}
private function handleBG(evt:Event):void
{
this.positionBG();
}
private function positionBG():void
{
this.backgroundMC.x = 0;
this.backgroundMC.y = 0;
this.backgroundMC.width = stage.stageWidth;
this.backgroundMC.height = stage.stageHeight;
addChild(backgroundMC);
}
}
}
View Replies !
View Related
Issue With AS & MovieClip Buttons
button1.onRollOver = over;
button1.onRollOut = out;
button1.onRelease = function(){
gotoAndPlay("portfolio");
}
button2.onRollOver = over;
button2.onRollOut = out;
button2.onRelease = function(){
gotoAndPlay("portfolio");
}
function over() {
this.gotoAndPlay("_over");
}
function out() {
this.gotoAndPlay("_out");
}
This above code is what I'm currently using to control my buttons.
button1 & button2 being the instance names of two buttons. "_over" & "_out" being the labels within those movieclips that activates the over and out states of my buttons. "portfolio" is a label on my maintime that i'm choosing to call. ( yes i know i have it listed for both, but that shouldn't matter since it would just call the same thing on each button )
my button1 is working fine, no flaws what so ever, but button2 is not doing anything. It's not even showing as a button when I test my movie. I did the same technique as I did in the first. ( i've checked over it like 20 times now ) Also, I noticed if I put my actions for these buttons in a certain keyframe it won't work, shouldn't it work no matter where I put it on the timeline? :cry:
View Replies !
View Related
Movieclip Depths Issue
Hi all..
I think you should have all the info needed to help me here...
If not.. let me know...
Basically, I am having trouble with movie depths in this script.
I want to able to load a movie in using the variable imgLoc2 which works fine...
(i know this because if i remove the lines:
Code:
tester1._x = origin[myName]._x;
tester1._y = origin[myName]._y;
I can see the movie successfully load...)
However, if those lines are there, the movie becomes masked under the blank tile, or the loaded tile current frame... (which only contains a holderclip for the tile tool, and a graphic of the number for the tile tool(which tool) )
...so i can't see it...
What do i need to do to fix this?
Code:
// ***************************************************************************
// ** Grid Drawing Functions **
// ***************************************************************************
// Simple function to ensure a consistent object naming structure
function tileName(x,y) { return "tile" + x + "_" + y; }
// Draw the blank tile board
function drawGridFoundation() {
// Initialize stacking depth for tiles
var tileDepth = 1000;
// Iterate through the rows
for (var gH:Number = 0; gH < level.gridHeight; ++gH) {
// Iterate through the columns
for (var gW:Number = 0; gW < level.gridWidth; ++gW) {
// Set name of the tile
var myName:String = tileName(gW,gH);
// Add tile movie clip (from library) to the display
origin.attachMovie("tile", myName, tileDepth);
origin[myName]._x = gW * level.tileSize;
origin[myName]._y = gH * level.tileSize;
// Set response for clicks on the tile; see function later
origin[myName].onMouseDown = function() { _root.updateTile(this);
tester1._x = origin[myName]._x;
tester1._y = origin[myName]._y;
tester1.loadMovie(imgLoc2);
};
// Increase tile depth for next time around
tileDepth++;
}
}
}
here is the function for updatetile:
Code:
// Change a tile to the current tool shape when clicked
function updateTile(who) {
// if it is NOT the player tool, then toggle on/off
if (_root.tool.current != 7) {
// only update the tile if this one was clicked on
if (who.hitTest( _root._xmouse, _root._ymouse, false)) {
// if this tile is not already set to the current, then set it
if (who._currentframe != _root.tool.current) who.gotoAndStop(_root.tool.current);
// if it is already set to the current, clear it
else who.gotoAndStop(1);
}
// but if it IS the player tool, then only allow one
} else {
// if it's this one
if (who.hitTest( _root._xmouse, _root._ymouse, false)) {
// if this tile is not player, and player has not be placed, place it here
if ((who._currentframe != _root.tool.current) && (!_root.tool.playerPlaced)) {
who.gotoAndStop(_root.tool.current);
_root.tool.playerPlaced = true;
// but if this tile is player, unplace it
} else if (who._currentframe == _root.tool.current) {
who.gotoAndStop(1);
_root.tool.playerPlaced = false;
}
}
}
}
- thanks
karmakat aka aleksandr berland
View Replies !
View Related
Nested MovieClip Issue
Code:
for(countCheck=0;countCheck<_root.carCount;countCheck++){
if(this._x+(this._width/2)>_root["Car"+countCheck]._x && this._x-(this._width/2)<_root["Car"+countCheck]._x &&
this._y+(this._height/2)>_root["Car"+countCheck]._y && this._y-(this._height/2)<_root["Car"+countCheck]._y){
_root["Car"+countCheck]._y=_root["Car"+countCheck].prevCarY;
_root["Car"+countCheck]._x=_root["Car"+countCheck].prevCarX;
}
}
okay, i have the above code inside a movieClip:
The movieClip acts as a wall in a game that if any car hits the wall, the car will stop.
This code works fine if i place this symbol on the _root directory
however if i place this inside another movieClip it no longer works!!!
can anybody tell me why?
thanks
View Replies !
View Related
Issue Calling Functions Within A MovieClip
I have a movie clip on my main timeline. I am attaching other movie clips to the main movie clip on my timeline. Here is the code:
Code:
map_mc.attachMovie("Marker", "Markers"+i, map_mc.getNextHighestDepth());
map_mc["Markers"+i].SetUrl(XmlPreferences.firstChild.firstChild.firstChild.firstChild + String(ID));
map_mc["Markers"+i].SetText(Left, Name);
map_mc["Markers"+i]._x = X;
trace(map_mc["Markers"+i]._x);
map_mc["Markers"+i]._y = Y;
I have done traces and X, Y, Left and Name as well as the Xml data I'm reading in has values, yet when I attempt to call my functions (which are defined inside of the Markers movie clip) they don't actually get called (It's just a simple trace ("YOU CALLED ME") inside of them).
What am I doing wrong? I've taken several Flash courses and have made several games with litterally almost the EXACT same code so I don't know what's wrong. Oh and I do have Linkage setup properly. I am also using Flash 8 but am targetting Flash 6 (though it does the same when targetting Flash 7 or 8)
View Replies !
View Related
[F8] MovieClip Creation And Deletion Issue
I have created a flash program that takes server rack information from a database and draws the racks on the fly. I only have 5 frames in my document, four representing the floor map and 1 that displays what is in the rack.
My method for drawing the rack is pretty simple. I have a completely blank movie clip in my library that I attach to the main movie by executing the following commands in the actions for frame 5:
var theRackDepth:Number = this.getNextHighestDepth();
this.attachMovie("RackMovie", "mcRack", theRackDepth);
The actions for creating the actual rack are defined in the actions of the RackMovie movie clip.
So basically the flow goes like this:
I start up the program and the main part of the map is showing. I click on one of the rack buttons, say for example the rack marked "Dell 5". It then uses LoadVars to send that info to a php script which polls the database. The php then sends back the info from the database which is stored into an array in the flash program.
I then call the command "gotoAndStop(5)" to go to frame 5 to display the rack. If I want to see another rack, there is a button on frame 5 that is supposed to remove the rack movie clip, ie "mcRack", and call the command "gotoAndStop(1)" to go back to the map.
Here is where I am having problems. To remove "mcRack", I have tried the following:
1) mcRack.removeMovieClip();
2) mcRack.unloadMovie();
3) removeMovieClip(mcRack); //both with and without quotes around mcRack
4) removeMovieClip(_level0.mcRack);
5) removeMovieClip(this.getInstanceAtDepth(theRackDep th));
Out of all those, the second one is the only one that will remove the movie clip and it will only do it once. It will clear the rack and take me back to frame 1. I am then free to click on another rack to bring up the picture of that. But when I try to go back to the map the second time, the picture of the rack remains on top of the map, with all the buttons on it still clickable.
I hope someone knows what I am doing wrong.
View Replies !
View Related
[F8] Movieclip Trailing Mouse Issue
Hello,
I have a movie with a movieclip that trails behind the mouse pointer. The code I'm using is:
Code:
box.onEnterFrame = function(){
var xMouse = _root._xmouse;
var yMouse = _root._ymouse;
if(Math.abs(xMouse - this._x) == 0) {
this._x = xMouse;
this._y = yMouse;
} else {
this._x -= (this._x-xMouse) / 8;
this._y -= (this._y-yMouse) / 8;
}
}
Everything works fine, and it trails smoothly most of the time. Unfortunately, occassionally the movieclip suddenly jumps to where the mouse pointer is, rather than sliding over to it. It doesn't seem to have any rhyme or reason, and is sometimes difficult to replicate. It seems to happen more often when I suddenly move the mouse pointer quickly across the screen.
Does anyone see anything in my code that could be causing this issue? I've attached an .fla as well, so that you can see for yourself.
Thanks for any insight.
View Replies !
View Related
[F8] Textfield In A Movieclip Depth Issue
Hi,
I am dynamically creating textfields in movieclips which works perfectly fine until I want to add multiple textfields via a for loop. So I'm thinking it must be a depth issue but I am not positive. Here's some of my code.
Code:
total = 6;
for (i=0;i<total;i++){
//create textobject and format attributes for entries
var entryTextFormat = new TextFormat();
entryTextFormat.font = "Helvetica";
entryTextFormat.size = 16;
// create entry textfileds and mc's
// create empty movieclip
_root.createEmptyMovieClip("mc"+i, this.getNextHighestDepth());
_root.mc._x = Math.round(Math.random()*300);
_root.mc._y = Math.round(Math.random()*300);
//create textfield inside of MC and set attributes
_root.mc.createTextField("txt+i",this.getNextHighestDepth(),0,0,500,400);
_root.mc.txt.embedFonts = true;
_root.mc.txt.text = userEntry[i];
_root.mc.txt.setTextFormat(entryTextFormat);
}
With the for loop it shows nothing. What am I doing wrong? Thanks in advance.
Also if I get delete the "+i" in the _root.createEmptyMovieClip("mc"+i, this.getNextHighestDepth()); line -- it will show the 6th entry.
View Replies !
View Related
Issue With Movieclip Generated Dynamically
hello!
i'm generating a bunch of Movieclips dynamically. Basically, a "stripContainer" gets attached 3 subContainer MCs "sequence1, sequence2,sequence3", each of which gets attached 100 or so subMCs containing each a jpeg ("image1",image2"...).
so each image mc should have a path that is similar to: _level0.stripContainer.sequence2.image32
Yet they are all attached to sequence0:
_level0.stripContainer.sequence0.image290
the result looks like what i want (up to a point) but when i look in the debugger, i see that indeed all the image MCs are attached to the sequence0.
sequence1 and sequence do get generated but they are empty.
Can you tell where is my mistake?
Here is my code:
ActionScript Code:
var finishedLoading:Boolean = false;
var h:Number = 0;
var i:Number = 0;
var imgLoader = new MovieClipLoader();
imgLoader.onLoadComplete = function(targetMC)
{
i++;
loadImg();
};
var mySequence:Object = sequencesHolder[0];
var sequenceMC:MovieClip = stripContainer.createEmptyMovieClip(mySequence.instance, stripContainer.getNextHighestDepth());
sequenceMC._x = mySequence.xPosStart;
sequenceMC.instance = mySequence.instance;
sequenceMC.onRelease = function()
{
trace("my name is:"+this);
};
loadImg = function ()
{
if (h<sequencesHolder.length)
{
var mySequence:Object = sequencesHolder[h];
if (i<mySequence.images.length)
{
var myImg:Object = mySequence.images[i];
var myMC:MovieClip = sequenceMC.createEmptyMovieClip(myImg.instance, sequenceMC.getNextHighestDepth());
myMC._x = myImg.xPosStart;
myMC.xPos = myImg.xPos;
myMC._xscale = myImg.startWidth;
imgLoader.loadClip(myImg.fileToLoad,myMC);
}
else
{
h++;
i = 0;
var sequenceMC:MovieClip = stripContainer.createEmptyMovieClip(mySequence.instance, stripContainer.getNextHighestDepth());
sequenceMC._x = mySequence.xPosStart;
sequenceMC.instance = mySequence.instance;
sequenceMC.onRelease = function()
{
trace("my name is:"+this);
};
loadImg();
}
}
else
{
finishedLoading = true;
}
};
loadImg();
thanks for your help!
View Replies !
View Related
Textfield In A Movieclip Depth Issue
Hi,
I am dynamically creating textfields in movieclips which works perfectly fine until I want to add multiple textfields via a for loop. So I'm thinking it must be a depth issue but I am not positive. Here's some of my code.
Code:
for (i=0;i<total;i++){
//create textobject and format attributes for entries
var entryTextFormat = new TextFormat();
entryTextFormat.font = "Helvetica";
entryTextFormat.size = 16;
// create entry textfileds and mc's
// create empty movieclip
_root.createEmptyMovieClip("mc"+i, this.getNextHighestDepth());
_root.mc._x = Math.round(Math.random()*300);
_root.mc._y = Math.round(Math.random()*300);
//create textfield inside of MC and set attributes
_root.mc.createTextField("txt"+i,this.getNextHighestDepth(),0,0,500,400);
_root.mc.txt.embedFonts = true;
_root.mc.txt.text = userEntry[i];
_root.mc.txt.setTextFormat(entryTextFormat);
}
With the for loop it shows nothing. What am I doing wrong? Thanks in advance.
View Replies !
View Related
MovieClip Parent/child Issue(s)
According to Flash CS3 Help:
parentproperty
parentisplayObjectContainer [read-only]
Language version: ActionScript 3.0
Player version: Flash Player 9
Indicates the DisplayObjectContainer object that contains this display object. Use the parent property to specify a relative path to display objects that are above the current display object in the display list hierarchy.
You can use parent to move up multiple levels in the display list as in the following:
this.parent.parent.alpha = 20;
Okay, I have a movieclip on my stage. Let's call it parentContainer_mc.
Now, let's say I open up this parentContainer_mc (by double clicking on it) and add a movieclip within parentContainer_mc.
Let's call this one childObject_mc.
What I want to do is change the alpha value of childObject_mc thru action script on the MAIN timeline.
If I put:
ActionScript Code:
childObject_mc.alpha = .5;
I get an error basically saying, "what the hell is childObject_mc?"
Okay, I know I need to use the parent/child relationship thingy.
Well, according to Flash CS3's help, I've tried:
ActionScript Code:
childObject_mc.parent.parent.alpha = .5; // Doesn't work
parentContainer_mc.parent.childObject_mc.alpha = .5; // Doesn't work
parentContainer_mc.childObject_mc.alpha = .5; // Doesn't work
// etc.. etc..
What's the correct code I need to use?
View Replies !
View Related
AS 2.0 - Controlling MovieClip Playback Issue
Hi,
Here's my situation:
------------------------
2 movieclips on the same layer on the root timeline: (instance name and linkage are the same)instance name: shards, 2 frames: labeled "default" and "stair"
instance name: shard_thumb, 2 frames: labeled "default_thumb" and "stair_thumb"
I am attempting to apply this code in the action panel of "shard_thumb":
Code:
onClipEvent (load) {
if (_root.shards.currentFrame == "default") {
this.gotoAndPlay ("stair_thumb");
stop();
}
else if (_root.shards.currentFrame == "stair") {
shards.gotoAndPlay ("default_thumb");
stop();
}
}
on (release) {
if (_root.shards.currentFrame == "default") {
_root.shards.gotoAndPlay ("stair");
stop();
}
else if (_root.shards.currentFrame == "stair") {
_root.shards.gotoAndPlay ("default");
stop();
}
}
The purpose is for when the movie loads, if the shard is in the "default" frame, the shard_thumb will display the "stair_thumb" frame, and vice versa if the shard mc is in the "stair" frame.
The other thing it must do, is if the shard_thumb mc is pressed while in the default_thumb frame, the shard mc will be set to the default frame label, and vice versa.
Thank you, and I hope this is not too confusing.
View Replies !
View Related
Nested Button Within Movieclip Issue
Hi,
I have buttons within a movieclip that display when rolling over the movieclip. The instance name of the moveclip is link1. However, once the buttons display, I'm not able to do anything with the buttons. I know from other posts that nested instances of onRollovers will not work but I haven't seen a clear work-around for what I'm trying to do. I've tried unsuccessfully using hittest, so if that's an option, a suggestion on how to correctly incorporate that would be greatly appreciated (or point me in the direction where there's a tutorial on this-I'd be happy to write up the solution and include here once resolved).
Below is the code which I have on an actions layer in the main timeline. As I mentioned, link1 is the instance name of the movieclip and btn_about is the instance name of one of the buttons that when clicked I want to go to another frame on the main timeline. I've also included a link to the swf to show what I'm trying to do.
link1.onRollOver = function() {
link1.gotoAndPlay("show");
}
link1.onRollOut = function() {
link1.gotoAndPlay("hide");
}
btn_about.onRelease = function() {
trace("release button About");
_root.gotoAndPlay("About");
}
btn_about.onRollOver = function() {
trace("rollover button About");
}
http://ekmstudios.com/nestedInstanceSample/rolloverSample.html
View Replies !
View Related
Help Having Issue With Animating MovieClip In Actionscript
Hello to all my favorite forum folks!
I have been using flash for a few years, on and off and have used the forums successfully for many issues I couldn't resolve.
Essentially I have a 3 layer Flash file.
First layer being actions, second is my Navigation (just text right now) and third is my photo (which is being used as a movie clip)
I am wanting to animate the photo from one xy coordinate to another using the same navigation button. I tried using frame labels and the gotoAndPlay function but I have had problems with this in the past and it just won't work.
Does anyone have any piece of code which I could use that would use a if/else statement to animate to certain xy coordinates.
I've been trying diferent things that have been posted on the forums to no avail. If anyone can help it would be appreciated. Thanks!
View Replies !
View Related
Unload / Remove / Movieclip Issue
Hello all, hopefully someone can shed a light on this.
i found a nice piece of code to display some pictures.
now i have a strange problem here.
(ps: everything happens on the maintimeline)
when a user clicks the photobutton this code triggers:
Code:
this.createEmptyMovieClip("photo"+photoNum, getNextHighestDepth());
this["photo"+photoNum].attachMovie("photo", "photo", getNextHighestDepth());
now the movieclip "photo" consist on another movieclip that does the actual picture display/loading with some AS> photoHolder < loads the actual picture
so i thought ok, logically its _root.photo.photoHolder.removeMovieClip();
maybe even _root["photo" + photoNum].photoHolder.removeMovieClip();
or _root.photo.removeMovieClip();
etc
i tried numerous other structures but i just can't get it to work, for some reasons i just can't unload the movieclip that shows the picture.
can anyone please give me a hint here? i tried posting it on other fora, but to no avail for now.
thanks heaps!
View Replies !
View Related
_parent Path/movieclip Issue
I have attached the .fla to explain a little clearer
I have a timeline with 4 movieclips in it. each movieclip has its own timeline too. Within each movie clip is a button telling teh _parent timeline to jump up a level and stop on a certain frame. Whilst there also stop the movieclip that resides on that frame. The later doesn't work???
Not sure why but the A/S doesn't seem to pick up the path to the second movieclip 'twoloopms'
Within scene 1 > 1loopms (mc) the right hand next button can find the parent level fine:
this._parent.gotoAndStop(176);
On this main top level it stops and the movieclip which sits in that keysframe plays automatically, even when I say:
this._parent._parent.twoloopms.gotoAndStop(54);
I am sure it should just work!!!
Any suggestions would be more than welcome
View Replies !
View Related
[AS2.0] Flash 8 Help Movieclip Loading Issue
I have a number of menu buttons (home, about, contact, etc). Each button loads a new/different movieclip onto the scene. Each movieclip when loaded plays up to frame 25 and stops.
When I click on any of the menu buttons, I want the current/loaded movieclip to continue playing until it reaches the end of the clip before loading the next.
I tried this actionscript with no luck!
Code:
aboutMenu.onRelease = function() {
_root.loadHere.gotoAndPlay(26);
if (_root.loadHere._currentframe == end) {
_root.loadHere.loadMovie("contact.swf");
}
};
I have been at this for quite some time now. Please help!
Ben
View Replies !
View Related
Rollover Movieclip/button Issue
okie so...i haven't really searched for another similar post, but then again..i don't know what to search for... basically, i have this animated button, pretty similar to what lee did...it's after his idea, you know... but i'm having some trouble... so onRollOver, onRollOut..i did it differently. i had the movie clip containing the background square, a graphic, and then, a button with the text in it, and the on(rollOver/Out) actions applied directly to the button. when the button reaches that middle area, when i click it, i want it to play some labeled frame... but..it won't..i've tried a whole lot of things, but i'm not sure i tried them in the right way, or all of them, for that matter...
here is the file
http://download.yousendit.com/B446101C47D28E01
(in lack of better hosting ideas)
so...any help is welcomed...
cheers
View Replies !
View Related
Movieclip.variable Issue: Cant Find Them Back
Hello!
This is for an "experimental" project, so bear with me it's not that complicated, it's just not the every day image gallery.
i'm loading a bunch of images according to an xml file which basically tells me in which folders are the images and how many there are.
now, i need to display each image in a strip: one next to each other. At first, each image is squeezed to 4 percent (_xscale:4). When the user clicks anywhere, the images should be rendered back to normal (_xscale:100) and thus repositioned in _x.
everything works fine until the click: normally the _x of each image is stored as a variable to its corresponding object, both in squeezed and full modes.
Yet it traces to "undefined" at the time i need that value.
Here is my code:
ActionScript Code:
var project = obj.firstChild;
var sequences = project.childNodes;
var project_title:String = project.attributes['ptitle'];
var project_folder:String = project.attributes['folder'];
var project_FullWidth:Number = 0;
var project_CompressedWidth:Number = 0;
var pointerXpos:Number = 0;
var pointerXposStart:Number = 0;
var totalImageCounter:Number = 0;
var imageHolders:Array = new Array();
var compressedFramePercent:Number = 4;
for (var i = 0; i<sequences.length; i++)
{
// create each strip image MovieClip and assign each with its nested variables
var folder:String = sequences[i].attributes['folder'];
var numOfImages:Number = Number(sequences[i].attributes['numOfImages']);
var namePattern:String = sequences[i].attributes['namePattern'];
var imgWidth:Number = Number(sequences[i].attributes['imgWidth']);
var imgHeight:Number = Number(sequences[i].attributes['imgHeight']);
var sequenceWidth:Number = Number(numOfImages*imgWidth);
project_FullWidth += sequenceWidth;
var sequenceCompressedWidth:Number = Number(numOfImages*compressedFramePercent);
project_CompressedWidth += sequenceCompressedWidth;
for (var j = 1; j<=numOfImages; j++)
{
totalImageCounter++;
var filename:String = namePattern.replace('#', j);
var fileToLoad:String = absoluteUrl+'/'+project_folder+'/'+folder+'/'+filename;
instance = 'image'+totalImageCounter;
var myImage:MovieClip= stripContainer.createEmptyMovieClip(instance, stripContainer.getNextHighestDepth());
myImage.ID = totalImageCounter;
myImage.fileToLoad = fileToLoad;
myImage.xPos = pointerXpos;
myImage.xPosStart = pointerXposStart;
myImage.startWidth = compressedFramePercent;
pointerXposStart = Number(pointerXposStart+compressedFramePercent);
pointerXpos = Number(pointerXpos+imgWidth);
imageHolders.push(stripContainer[instance]);
}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++
// INITIALISE A GENERIC LOADER TO SYNCHRONISE SEQUENTIAL LOADING
//+++++++++++++++++++++++++++++++++++++++++++++++++++
var imgLoader = new MovieClipLoader();
imgLoader.onLoadComplete = function(targetMC)
{
i++;
loadImg();
};
// START IMAGE DOWNLOAD, ONE BY ONE
var finishedLoading:Boolean = false;
loadImg = function ()
{
if (i<imageHolders.length)
{
var myObj:MovieClip = imageHolders[i];
myObj._x = myObj.xPosStart;
myObj._xscale = myObj.startWidth;
imgLoader.loadClip(myObj.fileToLoad,myObj);
}
else
{
finishedLoading = true;
}
};
loadImg();
//+++++++++++++++++++++++++++++++++++++++++++++++++++
// LISTEN FOR THE "EXPAND" CLICK
//+++++++++++++++++++++++++++++++++++++++++++++++++++
stripContainer.onRelease = function()
{
if (ViewingCompressed === true)
{
// **************PROBLEM COMES HERE ********
for (var a = 0; a<imageHolders.length; a++)
{
var myObj:MovieClip = imageHolders[a];
//** THE FOLLOWING SHOULD WORK, BUT DON'T !!!
myObj._xscale = 100;
myObj._x = myObj.xPos;
trace ('myObj.xPos: '+myObj.xPos);
}
ViewingCompressed = false;
}
};
If i count the number of items in imageHolders array, it renders the right number of elements, but they have all lost their nested variables...
i'm a bit desperate here .I hope someone has a clue. Thank you!
View Replies !
View Related
Issue With Movieclip Blocking Buttons Underneath
I've successfully set mouseEnabled or mouseChildren to false in order to allow buttons underneath a movieclip to be accessible. For some reason I have this movieclip now that contains a transparent PNG and even with both of those properties set to false, it is still blocking buttons that are underneath it. Is there something else I am missing?
View Replies !
View Related
Issue Accessing Movieclip Inside Window Component
Hi,
First of all, i apologize for cross posting, I didn't see the actionscript group when i initiallly posted in the Flash 8 group.
I'm having trouble accessing some components that reside inside of a movieclip that i'm displaying inside of a window component through the PopUpManager:
Code:
var my_MC = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, { title:"movieClip", contentPath:"my_MC", closeButton:true });
how can i access any components that exist within the linked movie clip in my library? i have two labels that I want to update but can't figure out for the life of me how...
i've tried:
Code:
_root.my_MC.content.<label name>.text = "blah blah blah"
but no worky.
any help is appreciated
thank you.
View Replies !
View Related
Live Preview / Published Resize Issue Of Custom Component That Extends MovieClip
uggggh!! I am really at my wits end. I have struggled with this hobbie project for well over 6 months and seem to be getting no where!!! I ahve read countless numbers of articles, documentation, etc. and seem to be even more confused than when I started.
I believe that my biggest problem is that I have spent so much time on this issue, and have read so many different posts, articals, etc. that I am not sure that is factual and what is not. I think I have even gotten confused on how basic functions actually work. ugh!!!
Could someone look over this code and tell be all the dumb crap I have done and how I can fix it. Here is a list of the issues I am having and can not seem to correct.
1) Live preview of the component scales correctly the very first time you scale it. All other times it seems to be using the original component size and adjusting it by the delta value of the scaling.
2) My text area during live preview 99% of the time does not appear.
3) When I Publish, the text within the component scales rather than being the font size I indicate even though I am using autoSize.
4) A problem that occurs some times is that the Published version of the component will be way way bigger than what live preview shows me.
So, please please please. Take a look at this class I have built and tell me all the dumb things I have done. The one things that I ask is that this component continue to extend movieClip.
Many thanks!!!!
Charles
Code:
import flash.filters.DropShadowFilter;
class com.camber.component.Balloon extends movieClip {
// Constants:
public static var symbolName:String = "Balloon";
public static var symbolOwner = com.camber.component.Balloon;
public var className:String = "Balloon";
public static var CLASS_REF = com.camber.component.Balloon;
public static var LINKAGE_ID:String = "Balloon";
// Public Properties:
// Private Properties:
private var balloonText:TextField;
private var _balloonText:String;
private var _dsDistance:Number;
private var _dsEnabled:Boolean;
private var updatedWidth:Number;
private var updatedHeight:Number;
// UI Elements:
// Initialization:
private function Balloon() {
this.init();
}
// Public Methods:
// ====== Text Field FUNCTIONS =================
[Inspectable(defaultValue="Text goes here", type=String)]
public function set text(zText:String){
try{
this._balloonText = zText;
} catch(err){
trace("ERROR in SET text():" + err);
}
//invalidate();
}
public function get text():String{
return _balloonText;
}
// ====== Drop Shadow Distance FUNCTIONS =================
[Inspectable(defaultValue=10, type=Number)]
public function set dsDistance(zSetTo:Number){
try{
if(zSetTo > 0){
this._dsDistance = zSetTo;
var x = this.getFilterIndex();
var filterList:Array = this.filters;
filterList[x].distance = this._dsDistance;
filters = filterList;
}
} catch(err){
trace("ERROR in SET dsDistance():" + err);
}
//invalidate();
//draw();
}
public function get dsDistance():Number{
return this._dsDistance;
}
// ====== Drop Shadow Enabled FUNCTIONS =================
[Inspectable(defaultValue=true, type=Boolean)]
public function set dsEnabled(zSetTo:Boolean){
try{
this._dsEnabled = zSetTo;
var x = getFilterIndex();
var filterList:Array = this.filters;
if(_dsEnabled){
filterList[x].strength = 1;
} else {
filterList[x].strength = 0;
}
filters = filterList;
} catch(err){
trace("ERROR in SET dsEnabled():" + err);
}
//invalidate();
}
public function get dsEnabled():Boolean{
return _dsEnabled;
}
// Semi-Private Methods:
// Private Methods:
// ====== Init FUNCTION =================
private function init(){
try{
this.updatedWidth = this._width;
this.updatedHeight = this._height;
this.createChildren();
//_dsDistance = 10;
//_dsEnabled = true;
this.instanceDS();
} catch(err){
trace("ERROR in init():" + err);
}
}
// ====== CreateChildren FUNCTION =================
private function createChildren(){
super.createChildren();
//size();
try{
this.createTextField("balloonText", this.getNextHighestDepth(), 6, 6, this.updatedWidth - 12, this.updatedHeight - 12);
this.balloonText.autoSize = true;
this.balloonText.text = _balloonText;
} catch(err){
trace("ERROR in createChildren():" + err);
}
}
// ====== Instance Drop Shadow FUNCTION =================
private function instanceDS(){
try{
var angleInDegrees:Number = 45;
var color:Number = 0x000000;
var alpha:Number = .75;
var blurX:Number = 10;
var blurY:Number = 10;
if(this._dsEnabled){
var strength:Number = 1;
} else {
var strength:Number = 0;
}
var quality:Number = 2;
var inner:Boolean = false;
var knockout:Boolean = false;
var hideObject:Boolean = false;
var dsFilter:DropShadowFilter = new DropShadowFilter(this._dsDistance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject);
var filterArray:Array = new Array();
filterArray.push(dsFilter);
filters = filterArray;}
catch(err){
trace("ERROR in instanceDS():" + err);
}
}
// ====== GetFilterIndex FUNCTION =================
private function getFilterIndex():Number{
try{
for(var i in filters){
if(this.filters[i] instanceof DropShadowFilter){
trace("filters.length:"+filters);
trace("filters[index]:"+i);
var index = i;
break;
}
}
return index;
} catch(err){
trace("ERROR in getFilterIndex():" + err);
}
}
// ====== Draw FUNCTION =================
private function draw(){
super.draw();
try{
//this.balloonText.text = _balloonText;
//this._balloonText = "this._width = " + this._width + "
";
//this._balloonText += "this.width = " + this.width + "
";
//this._balloonText += "this.balloonText._width = " + this.balloonText._width + "
";
//this.balloonText._width = this._width - 12;
//this.balloonText._height = this._height - 12;
this.balloonText.removeTextField();
createChildren();
this._balloonText = "this._width = " + this._width + "
";
this._balloonText += "this.width = " + this.width + "
";
this._balloonText += "this.updatedWidth = " + this.updatedWidth + "
";
this._balloonText += "this.balloonText._width = " + this.balloonText._width + "
";
} catch(err){
trace("ERROR in draw():" + err);
}
}
// ====== Size FUNCTION =================
private function size(){
super.size();
try{
this.updatedWidth = width;
this.updatedHeight = height;
//this.balloonText._width = this._width - 12;
//this.balloonText._height = this._height - 12;
} catch(err){
trace("ERROR in size():" + err);
}
//draw();
//invalidate();
}
private function onLoad(){
draw();
}
}
View Replies !
View Related
[CS3] Still Having Clock Time Zone Issue---and Dynamic Text Box Issue
I'm trying to do a clock that displays another time zone. The problem I'm having is that instead of running on a 12 hour clock, its on a 24hr one.
any insight as to how I can change the time?
Currently the clock is displaying
23:00p-Jul.22
I want it to display 11:00p-Jul.22
var dayText:String;
var dateText:String;
var monthText:String;
var AmPm:String;
_root.onEnterFrame = function() {
var myDateate = new Date();
//var sec:Number = myDate.getSeconds();
var min:Number = myDate.getMinutes();
var hour:Number = myDate.getHours();
var day:Number = myDate.getDay();
var date:Number = myDate.getDate();
var month:Number = myDate.getMonth();
//var year:Number = myDate.getFullYear();
//sec = sec<10 ? "0"+sec : sec;
min = min<10 ? "0"+min : min;
//AM/PM
if (hour>12) {
hour = hour-12;
AmPm = "p";
} else {
AmPm = "a";
}
//day
if(date == 1 || date == 21 || date == 31) {
dateText = date+"";
} else if(date == 2 || date == 22) {
dateText = date+"";
} else if(date == 3 || date == 23) {
dateText = date+"";
} else {
dateText = date+"";
}
//month
if (month == 0) {
monthText = "jan";
} else if (month == 1) {
monthText = "feb";
} else if (month == 2) {
monthText = "mar";
} else if (month == 3) {
monthText = "apr";
} else if (month == 4) {
monthText = "may";
} else if (month == 5) {
monthText = "jun";
} else if (month == 6) {
monthText = "jul";
} else if (month == 7) {
monthText = "aug";
} else if (month == 8) {
monthText = "sep";
} else if (month == 9) {
monthText = "oct";
} else if (month == 10) {
monthText = "nov";
} else if (month == 11) {
monthText = "dec";
}
//display
dateDisplay.text = hour+":"+min+ AmPm + "-" + monthText+"."+ dateText;
};
View Replies !
View Related
|