[mx04] Can't Access Buttons Inside Scrolling Mc
I have a group of buttons that are grouped together and animated to move continuously across a MC. This SWF gets dynamically loaded into my main movie. Now, I want to be able to click on the buttons in the loaded SWF, and have the button click cause another SWF to be loaded into a different empty MC.
Can anyone help, please?
Thank you in advance.
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 11-22-2004, 08:29 PM
View Complete Forum Thread with Replies
Sponsored Links:
[mx04] Can't Access Buttons Inside Scrolling Mc
I have a group of buttons that are grouped together and animated to move continuously across a MC. This SWF gets dynamically loaded into my main movie. Now, I want to be able to click on the buttons in the loaded SWF, and have the button click cause another SWF to be loaded into a different empty MC.
Can anyone help, please?
Thank you in advance.
View Replies !
View Related
Getting Flash Buttons Inside Swf File To Access Url In Dreamweaver
All the things I could do in Flash mx and can no longer do in mx04.
I have created simple rollover buttons within a Flash swf file. This file is loaded into a Dreamweaver page. I want to be able to go to another page in the website by pressing the buttons. I have tried to code it but it does not work:
attempt 1:
on (release) {
getURL(principal.htm_self);
}
attempt 2: 'aboutus' is the name of the folder in which the htm tag is located
on (release) {
getURL(aboutus/principal.htm_self);
}
View Replies !
View Related
AS3 Global Variables And How To Access Buttons Inside Movieclips
Hi, I am making a simple game and I have an option to change the player appearance.
Problem is I tried to use a variable to detect and change clothes but it doesn't work.
I have already declared the variable using var playerClothes= "normal"; but it seems because the clothes movieclip is in another movieclip, it can't access the variables.
I've tried package to make global variables, but it says my package is unexpected although the code checker says there are no errors. I put the package in the first frame.
I have also the same problem when trying to access a button inside a movieclip it can't find it....
View Replies !
View Related
[mx04]Continuously Scrolling Buttons -- Not Continuous
Hi,
I have a set of MC's which I have made clickable and I want to have them scroll continuously across the stage.
I have worked it out so that the buttons will scroll across the screen once but then there is a long gap before this starts over again. I need this to be an unbroken loop.
I also have another problem which has to do with dynamically loading this scroller into a level, at specific coordinates. I can get both the nav bar and the scroller to show up stacked the right way, but I can't seem to get the nav bar to be at the correct _x & _y.
Thanks in advance for any help. I have been searching very hard, but can't seem to find a tutorial or post that covers what I need. Not super savy with the whole programming thing still, so I need some hand holding.
***File: http://www.soundtekstudios.com/pat/topBanner.zip *** 127.5 KB
View Replies !
View Related
Scrolling Buttons Inside A Movieclip
Hello again!!
I had a small problem with scrolling buttons. They are scrolling to the left so as the user scrolls they move etc etc.
However I have this inside a movie clip and i cant get it working at all, I think its because its inside a movie clip not the main timeline so I have to add more code.
Any advice, here is the code I am using.
Thanks
_root.onEnterFrame = function () {
this_aboutbtn_mc._x = (-5.5/416 * _root._xmouse)+10.0
}
George
View Replies !
View Related
Buttonless Scrolling MC, Buttons Inside Not Working
I have done it on other Flash sites and the method worked (as per tuts here)... a button inside a buttonless scrolling MC that's to link to another scene.... isn't working to save my life. The scrolling PROJECT SECTION thumbnails are supposed to click and take you to a scene with a description of the project, and I intend to use this technique also for the Executives section. (if I can get it to work). I only have the left three thumbs set up as linked buttons so far (if they worked)
http://designsourceadvertising.com/ndc-help.zip (2.6MB .FLA)
Any help would be much appreciated. pleezpleezpleez
View Replies !
View Related
Buttonless Scrolling MC, Buttons Inside Not Working
I have done it on other Flash sites and the method worked (as per tuts here)... a button inside a buttonless scrolling MC that's to link to another scene.... isn't working to save my life. The scrolling PROJECT SECTION thumbnails are supposed to click and take you to a scene with a description of the project, and I intend to use this technique also for the Executives section. (if I can get it to work). I only have the left three thumbs set up as linked buttons so far (if they worked)
http://designsourceadvertising.com/ndc-help.zip (2.6MB .FLA)
Any help would be much appreciated. pleezpleezpleez
View Replies !
View Related
How To Make: Vertical Scrolling Menu With Text Links Or Buttons Inside?
Hi,
I need to learn how to create a scrollable text field in Flash MX professional with scrolling links (or buttons), similar to this: http://www.macromedia.com/cfusion/kn...fm?id=tn_16142
The text inside the scroll needs to be linkable to url’s or other .swf or html files.
Please help. It’s like a vertical scrolling menu with text links or buttons inside.
Can you please help me out with a link on the web or tutorial so I can learn to do this.
Bye,
Dan
Email: gupi73@hotmail.com
View Replies !
View Related
[MX04] Preventing Access
Is is possible to produce a Flash movie, run it and prevent users from gaining access to other functions of the computer such as right clicking or altering the window size (assuming it's a Windows OS)? This would be in use by the public so the keyboard would be physically hidden.
Any help or suggestions?
View Replies !
View Related
[mx04] Xml To Access CD Drive
Hi,
I'm having trouble trying to link a .swf using xml to open up an html link that is on the cd that a user will have in their drive when running the swf.
home.swf > goes to CD drive> open up about.html
example of xml:
<linktype="sample" display="yes" ref="file:///d:/about.html">
is there some kind of wild card to access the CDROM drive?
any help will be greatly appreciated.
View Replies !
View Related
[MX04] Access External Movie
Hi:
I would like to set height after I load an external movie into a movie clip.
For example,
this.body_mc.loadMovie("body_about.swf");
_root._height = this.body_mc._height;
Does these make sense?
I always get height as 0, because body_mc is an empty movieClip.
Can anyone help me on how to access the body_about.swf height as soon as loaded the movie into the empty movie clip? Any suggesstion?
Thanks
View Replies !
View Related
Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,
I'm pretty new to actionscript, and I'm kinda moving along; up until now.
I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.
The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.
I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.
I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.
Any help would be appreciated, since I'm about ready to shed tears over this.
Thanks!
-Sam
View Replies !
View Related
Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,
This question is going ignored in some other boards, so I thought I'd try here....
I'm pretty new to actionscript, and I'm kinda moving along; up until now.
I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.
The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.
I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.
I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.
Any help would be appreciated, since I'm about ready to shed tears over this.
Attached is the zipped fla file
Thanks!
-Sam
View Replies !
View Related
[MX04] Xml.sendAndLoad Issue... Data Loads But Cant Access Attributes?
Im using xml.sendAndLoad to manipulate an xml file. I have no issues saving to and loading from the file, but for some reason after i appendChild and saveAndLoad I cant access any of the attributes of the new child.
For instance i will get this back as the new child:
<server name="fff" address="fffff" />
but if i do myNode.attributes.name or myNode.attributes.address i get "undefined".
If I close the swf and run it again the values that were showing as "undefined" load fine, all pre-existing nodes load fine as well, its only the nodes added before sendAndLoad that for some reason return "undefined" when trying to access their attributes although as you can see the attributes are right there!
Please help!
View Replies !
View Related
Access Mc Inside Button?
MX 2004 Pro:
I need to change the color of an MC instance (Test1) that is on the UP frame of a button (btnTest).
ActionScript Code:
trace(btnTest.Test1._width)
returns "undefiend". But when I turn the button into a MovieClip:
ActionScript Code:
trace(mcTest.Test1._width)
returns a correct value, meaning, I can access Test1.
Is there a way to access MC instances inside a button?
View Replies !
View Related
Access A Function That Is Inside Of A Swf From Another Swf
Hi,
I'd access a function that is inside of a swf that is loaded by a Loader. For example:
-I have a function at mundo.swf called : ola();
-I am loading this swf at another swf :
Code:
var urlReq:URLRequest = new URLRequest();
var loader:URLLoader = new URLLoader();
urlReq.url="mundo.swf";
ldr2.load(urlReq);
addChild(ldr2);
- I wanna access this function (I 'm trying:
Code:
var Variavel =MovieClip(ldr2.content);
Variavel.ola();
Thanks!!!!!!!
View Replies !
View Related
Access A Var Inside A Child MC
Hi,
I'm new to AS3 and have a movie clip on the stage that contains a var,
the MC is called "myMC"
ie
Code:
var path = "my path";//this is in the first frame of myMC
I want to access this value from the parent element, in this case it is the stage.
So on the first frame on my stage i have,
Code:
trace(myMC.path);// this returns underfined
This would work in AS2.
Can i access this or do i need to create a class to access vars of a child?
Thanks in advance.
PS, i have had a good hunt arround for this simple problem but can only find solutions for accessing the stage properties from within a child grrr.
Cool
View Replies !
View Related
How To Access A Variable Inside A Movieclip?
Hey I'm new to Flash and use Flash MX 2004.
I'm creating a game where I duplicate an alien movieclip 20 times. Inside each alien movieclip is its own variable called speed. During the game their speed varies.
What I'm trying to do is have a function that will loop through the 20 aliens and multiply their speed by 3. I tried using a for loop and doing eval(currentalien + i + "_mc").speed *= 3; but that didn't work. And when I did a trace I got undefined. So I guess it can't access it.. and that's my problem. How can I make this work?
View Replies !
View Related
Access Button Inside Movieclip
Hey Everyone,
I am not that familiar with Flash yet, so I have trouble accessing a button inside a Movieclip that I have loaded by using the loadMovie command.
code:
createEmptyMovieClip("menu",1);
menu.loadMovie("menu1.swf",1);
menu.button.onPress = function(){
trace("works");
}
My movie loads fine and my button has the instance name button. So that should not be the problem.
Thanks for any help,
Andy
View Replies !
View Related
Access Class Inside Loaded SWF
Hello
I have a problem i can't really figure out. Here's the case.
I have a .fla with a document class. Inside the documentClass i load another SWF. The SWF loaded has objects with Classes linked. Like: "com.menu.item".
When i have loaded the SWF i can access the objects through the following from my documentClass:
import com.menu.item;
var _item: item = new item()
addChild(_item)
This works fine and i can see the object being added. The problem is that the object has a timeline and that timeline doesn't work. A simple stop is not triggered. Anyone have an idea how to fix that?
Any help appreciated
Regards
Rick
View Replies !
View Related
Access Content Inside A Tilelist?
If I populate a tilelist with movies from the library', is there a way I can access these? I know with a scrollpane, I can do something like
MovieClip(scroller.content).instanceIwantToAccess. addEventListener(MouseEvent.CLICK, handler);
Is there something similar I can do with the tilelist?
View Replies !
View Related
Access Mc Inside Dynamically Attached Mc? Please Help
I have an array of dynamically attached mc's, and I want to set text in a textfield that is inside movieclip that is inside each one of the attached mc's. I keep getting this error:
TypeError: Error #1010: A term is undefined and has no properties.
Here is the part of my code I'm having problems with. The mc is "square," the mc inside of it is "thumbText_mc," and the textfield inside of that is "hoverText":
Code:
function createThumbs(){
var myXML:XML=new XML(xmlLoader.data);
for (var z:int = 0; z<(myXML.image.length()); z++){
var but:square = new square();
butContainer.addChild(but);
but.name = "button" + z;
butArray[z] = butContainer.getChildByName("button" + z);
butArray[z].x = (z*300);
butArray[z].y = 0;
butArray[z].buttonMode = true;
butArray[z].addEventListener(MouseEvent.CLICK, loadThumb);
var thumbs = butArray[z];
thumbs.num = z;
thumbs.thumbText_mc.hoverText.text = (myXML.image[z].@capTwo);
Thanks in advance
View Replies !
View Related
Access Button Inside Of Loaded Swf
Hello to all! So, i'm loading a swf (image gallery) that fills the entire index movie's stage. I created a "close" button in the swf. So, you're inside the index movie and click gallery. It loads on top of the entire index movie so it appears as an image gallery with a solid background, none of the index elements are seen, but exist behind the gallery swf. What i want to do is access the close button in the gallery swf so when it's clicked, it closes and the index stage is being viewed again. Ideas? Helpful Hints? Are the Lakers going win?
View Replies !
View Related
Access Content Inside A Tilelist?
If I populate a tilelist with movies from the library', is there a way I can access these? I know with a scrollpane, I can do something like
MovieClip(scroller.content).instanceIwantToAccess. addEventListener(MouseEvent.CLICK, handler);
Is there something similar I can do with the tilelist?
View Replies !
View Related
Access Text Field Inside Movie
I want to address a text field ("/ann_input") which is located inside a mc ("/ann_mov"). How do I do that? This is what I've tried out already:
Code:
onClipEvent (enterFrame) {
if (ann_mov._currentFrame == 2 AND ann_mov.ann_input != "") {
this.gotoAndStop(2);
}
}
also:
Code:
onClipEvent (enterFrame) {
if ("/ann_mov"._currentFrame == 2 AND "/ann_mov"."/ann_input" != "") {
this.gotoAndStop(2);
}
}
- naturally, neither works. HELP!
View Replies !
View Related
Access Instance Inside Movie Clip
Hi all iam khader ,
Really i have small problem ,which is how can i access an instance inside movie clip,
i tried to wirte the following
_root.movieclip1.instancename ;
when i wrote this code it just access the movieclip1 and it dosn't arrive to the instancename inside it so how i control this instance using action scrip in flashMx
thanx alot
View Replies !
View Related
Access Content Inside Window Component?
Is there any way that I can access for instance box_mc which is inside window component that is created by:
MyWindow = PopUpManager.createPopUp(_root, Window, false, {closeButton:true, title:" - Testing!", contentPath:"box_mc"});
with AS 2 player 7.
I tryed
MyWindow.box_mc._x+=50;
but it doesn't work.
View Replies !
View Related
Can't Access Array Inside 'onRelease' Function
Another issue from this site i'm trying to put together... *sigh*. So I've got a bunch of nested for loops, and i'm trying to add dynamic behavior to a movieclip that was just created. I want it to attach x number of movies when it is clicked, and x is stored in an array. When i try to access the array from within the onRelease function, it comes up as undefined. looking for a way to access it, or a work around to access it. Thanks for your help.
The applicable section is in Blue.
Code:
if (pageList.firstChild.childNodes[i].childNodes.length > 0) {
for(var j = 0; j<pageList.firstChild.childNodes[i].childNodes.length; j++) {
_root["subSect"+j] = [];
_root["subSect"+j].push(pageList.firstChild.childNodes[i].childNodes[j].attributes.title);// [0]subSection title
_root["subSect"+j].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes.length);// [1] subSection # of pieces
_root["sect"+i].push(_root["subSect"+j][0]);
menuCount++;
//create menuSubItems
_root.createEmptyMovieClip("m_mc"+menuCount,_root.getNextHighestDepth());
_root["m_mc"+menuCount].createTextField("m_items_txt",_root.getNextHighestDepth(),menuX,menuY,100,20);
_root["m_mc"+menuCount].m_items_txt.embedFonts=false;
_root["m_mc"+menuCount].m_items_txt._alpha=100;
_root["m_mc"+menuCount].m_items_txt.text=sectList[i][j+1];
_root["m_mc"+menuCount].m_items_txt.setTextFormat(midLvl_fmt);
menuY+=12;
menuX+=15;
if (pageList.firstChild.childNodes[i].childNodes[j].childNodes.length>0) {
for(var k = 0; k<pageList.firstChild.childNodes[i].childNodes[j].childNodes.length; k++) {
_root["artwork"+k] = [];
_root["artwork"+k].push(_root["subSect"+j][0]); //[0] section title
_root["artwork"+k].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.title); //[2] piece title
_root["artwork"+k].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.desc); //[3] piece descrip
_root["artwork"+k].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.fileLoc); //[4] piece piece File loc
_root["subSect"+j].push(_root["artwork"+k]); //add artwork beneath subsections
}
}
trace(_root["subSect"+j][1]);
//make each subMenu clickable so that it pulls up the appropriate # of imageLink buttons
_root["m_mc"+menuCount].onRelease = function() {
for(var m = 0; m<_root["subSect"+j][1]; m++) {
attachMovie("imageLink", "imageLink"+m, _root.getNextHighestDepth());
_root["imageLink"+m]._x=150+(m*10);
_root["imageLink"+m]._y=300;
}
}
}
}
View Replies !
View Related
Access To Variables Inside A Loadvars Function
Hi. In example#1 i have the variable.................var username = this.load........i'd like to know how to access the varible from other parts of the action script.
In example#2 i tried to trace the username from outside the onLoad function but the trace output is.... undefined.
will somebody please tell me how to access the var username:String = this.valid;..........variable?
example #1
var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function(success) {
var username:String = this.valid;
_root.msg.text = username;
trace(username);
}
myLoadVars.load('test4.php');
////////////////////////////////////////////////////////////
example #2
var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function(success) {
var username:String = this.valid;
_root.msg.text = username;
trace(username);
}
myLoadVars.load('test4.php');
trace (username);
View Replies !
View Related
Any Way To Access Embedded Domain Url From Inside Flash?
I've got a flash movie that a lot of people are embedding in different spots, and I'd like some way to track which domains it shows up on. A lot of the embedding is going on in myspace, so I don't want to do anything crazy like Javascript/Actionscript Gateways or proxies, cause I dont' think they'll allow it.
Seems like the embedded domain should be a local variable inside Flash, but I sure can't find it. The localConnection class's domain() method just returns my own server, cause that's where the swf is.
Any ideas? I'm beginning to think it's just not possible.
View Replies !
View Related
Access Variables Declared Inside Functions
Hi guys, i have a problem in AS3
I have a problem with a function that needs to access a variable declared inside another function.
What I understand is how a variable can change due to var X:Number=0
because var PictureLink:String = Array[X] when X increments. What i don't understand is how when an event listener listens for a mouse click on a movieclip which load another movieclip with link PictureLink, it knows which Array[X] it is when the X has already incremented through all the pics.
By the tutorial I watched (Cartoon Smart AS3 XML Gallery), he said "we need to create variable PictureLink to store Array[X] at a particular time to when user click on thumbnail, it goes to the correct link.
This all worked fine but the code was getting too long and i wanted to seperate this massive functions into their own .as files, this is when it stuffed up.
WHY, because the loaded was refering to Array[X] when that var was declared in the previous function and now I can't reference it .
Here's my code. Some things aren't in the, like gallery pane and some other layout script because they're in other .as files, they won't matter though to solve the problem.
Code:
var mainPicArea:MovieClip = new MovieClip();
mainPicArea.buttonMode = true;
mainPicArea.useHandCursor = true;
addChild(mainPicArea);
var all_thumbs:MovieClip = new MovieClip();
all_thumbs.buttonMode = true;
all_thumbs.useHandCursor = true;
addChild(all_thumbs);
galleryPane.source = all_thumbs;
var fadeIn:Tween;
var fadeOut:Tween;
var urlVar:String = "xml/gallery.xml";
var highResPathList:Array = [];
var lowResPathList:Array = [];
var thumbPathList:Array = [];
var pictureTitleList:Array = [];
var pictureDescList:Array = [];
var totalPics:Number;
var mainPicPlacementX:Number;
var mainPicPlacementY:Number = 100;
//LOAD THUMBNAILS
var thumbLoader:Loader;
// variable for load thumbs function loop
var c:Number = 0;
// spacing between each thumb on x-axis. Number includes thumb width plus spacing
var xSpacing:Number = 105;
// spacing between each thumb on y-axis
var ySpacing:Number = 105;
//how many thumbs are occupying a row
var xs:Number = 0;
//how many thumbs are occupying a column
var ys:Number = 0;
var thumbRowCount:Number;
var thumbColumnCount:Number;
var thumb_orientation:String;
//////////////////////
function loadTheThumbs()
{
thumbLoader = new Loader();
var thumbRequest:URLRequest = new URLRequest(thumbPathList[c]);
thumbLoader.load(thumbRequest);
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, whenThumbsLoad);
function whenThumbsLoad(event:Event):void
{
var thisMainsLink:String = highResPathList[c];
var thisThumbsLink:String = lowResPathList[c];
var thisPicsTitle:String = pictureTitleList[c];
var thisPicsDesc:String = pictureDescList[c];
//spread thumnails along x-axis by xs
thumbLoader.x=(xs*xSpacing); //add pixels to end of equation for a buffer. For eg ....+8 (optional)
//spread thumnails along y-axis by ys
thumbLoader.y=(ys*ySpacing);
if (thumbColumnCount==0){
xs = xs + 1;
//trace("row space")
}
if (thumbRowCount==0){
//trace("column space")
ys = ys + 1;
}
if (thumbColumnCount==0 && xs==thumbRowCount) //if row has reached the max thumbs per row, then start a new row
{
//trace("row add")
//by reseting the x placement
xs = 0;
//on a different row
ys = ys + 1;
}
if (thumbRowCount==0 && ys==thumbColumnCount) //if row has reached the max thumbs per column, then start a new column
{
//trace("column add")
//by reseting the x placement
ys = 0;
//on a different row
xs = xs + 1;
}
thumbLoader.addEventListener(MouseEvent.CLICK, loadMainPic); //listener when thumbnail has been clicked
all_thumbs.addChild(thumbLoader);
c = c + 1;
if (c<totalPics)
{
loadTheThumbs(); // calls the first function in this file again (for the amount of thumbs)
} else {
xs=0;
ys=0;
c=0;
}
} // end if(c<totalPics)
} // end whenThumbsLoad
} // end loadTheThumbs
///////////////////
function loadMainPic(event:MouseEvent):void
{
thumbLoader.removeEventListener(MouseEvent.CLICK, loadMainPic);
if (mainPicArea.numChildren == 1){
mainPicArea.removeChildAt(0);
}
picDesc.text = "";
picTitle.text = "";
loadingText.x = mainPicPlacementX;
loadingText.y = mainPicPlacementY;
var mainLoader:Loader = new Loader();
var mainRequest:URLRequest = new URLRequest(thisThumbsLink); ////THIS IS THE PROBLEM, I CAN'T GET "thisThumbsLink from 'whenThumbsLoad function"
mainLoader.load(mainRequest);
mainLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler); //listener while main pic loading
mainLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, mainLoaded); //listener when main pics has loaded
function progressHandler(event:ProgressEvent):void //pre-loader function
{
var kbLoaded:String = Number(event.bytesLoaded/1024).toFixed(1);
var kbTotal:String = Number(event.bytesTotal/1024).toFixed(1);
loadingText.text = "Loaded "+kbLoaded+" of "+kbTotal + " KB";
} // end progressHandler
function mainLoaded(event :Event):void
{
thumbLoader.removeEventListener(MouseEvent.CLICK, loadMainPic);
loadingText.text="";
if (thumb_orientation == "horizontal" || thumb_orientation == "vertical"){
mainPicPlacementX = (stage.stageWidth / 2) - (mainLoader.width / 2); //if you want mainPic to move on x-axis in relation to stage
mainPicArea.x=mainPicPlacementX;
}
mainPicArea.y=mainPicPlacementY;
mainPicArea.addChild(mainLoader);
fadeIn = new Tween(mainPicArea,"alpha", None.easeNone, 0, 1,1, true)
picTitle.text = thisPicsTitle;
picDesc.text = thisPicsDesc;
picTitle.x = mainPicArea.x;
picDesc.x = mainPicArea.x;
picTitle.y = mainPicArea.y + mainPicArea.height + 5;
picDesc.y = mainPicArea.y + mainPicArea.height + 20;
picTitle.width = mainPicArea.width;
picDesc.width = mainPicArea.width;
} //end mainLoaded
} // end loadMainPic
i'm new to as3 so i would love any knowledge on the issue or any direction. Also another thing i would love to know, how to send values from function along with eventListener, that would solve the problem, being able to send variables through the event listener into the function that gets triggered.
Cheers
KayaScript
View Replies !
View Related
Access A Component Inside External Swf File
Hi, I loaded a external swf file that it is a dialog.
var swfLoader : Loader = new Loader();
var swfURL : URLRequest = new URLRequest("dialog.swf");
swfLoader.load(swfURL);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoaded);
function imgLoaded(event:Event):void
{
var movie : * = swfLoader.content;
var clip : MovieClip = movie;
parent.addChild(clip);
}
Now, inside the movieClip there is a TextField component named message that i want to change its 'text' property.
The question is: How can i access to this property to change it?
Regards
View Replies !
View Related
Access To Variables Inside Class File
Hello,
I'm trying to set up a class file that will read a bunch of links from an XML document so I can populate some buttons on the stage. The problem I am having is gaining access to the links within the class file. I have no clue how to get at "theWebsite" from the main document. Any help would be greatly appreciated!
This is what I have so far
Class file:
Code:
package {
import flash.display.MovieClip;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.events.*;
public class xmlLinkLoader{
//VARIABLES & Event Listeners HERE
trace("xml Link Loader CLASS Imported");
public var theText:TextField;
public var theWebsite:String;
public var myWebsiteLink:String;
public var myURLLoader:URLLoader= new URLLoader();
public var xmlData:XML = new XML();
public var myURLRequest:URLRequest= new URLRequest("links.xml");
public function xmlLinkLoader() {
myURLLoader.load(myURLRequest);
myURLLoader.addEventListener(Event.COMPLETE,dataOK);
}
public function dataOK(myevent:Event):void {
trace("xml loaded");
xmlData = new XML(myevent.target.data);
for (var i=0; i<xmlData.splashlink.length(); i++) {
var websiteLink = xmlData.splashlink.@theBandsWebsite;
}
populateMe();
trace(websiteLink);
}
public function populateMe() {
trace ("populated");
var theWebsite = xmlData.splashlink.@theBandsWebsite;
}
//
}
}
Document:
Code:
import xmlLinkLoader;
var myxmlLinkLoader= new xmlLinkLoader;
View Replies !
View Related
[MX04] MC Inside MC Menu
Ok so I know this question must have been asked before by someone but I've been searching the web as well as tons of forums and can't come up with a solid answer. Here is my question:
I have a simple nav/menu that when on rollover displays a sub-menu. Now I know that since I have the sub-menu as MC's nested inside another MC, the sub-menu won't work. However, is there a solution to getting these to work? Or is there a better way to create this sub-menu?
If anyone could give some ideas or just point me to a thread, that would be wonderful. The code I am using on the first frame of the "Sponsors" menu item MC is as follows:
Code:
stop ();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
}
this.onRollOut = function(){
rewind = true;
}
I've tried to attach an .fla of the menu but it's not working. Please see http://www.mcmasterminibaja.com/top_bar.html for the .swf. The sub-menu only appears on the "Sponsors" item.
Thanks a ton!
-Kyle
View Replies !
View Related
[MX04] Embedding A URL Inside Of A MC?
Hey gang,
I've been putting together this Orientation presentation for my company and thought I had everything finished, but when I tested it on multiple machines I ran into what is evidently a Flash bug. What I have going is an exe shell that loads different swf "slides" into a mc container as the user clicks through. 2 of my swfs play rather large flv files. Everything is stored on a shared network drive. Delivering the content via a web ap is a no go (bandwidth issues... IT told me no.) The issue that I am experiencing is that when 2 or more users try to watch the video at the same time, the first user can see it and it will not load for anyone else. The info I found said that flvs can not be shown to multiple users at the same time via a local machine because of a known bug within Flash. So now I'm trying to think of a way around it.
I tried a hybrid approach of just putting my flv and the swf that controls it on the web server and then loading the swf into the container on the local machine and I get the same problem. Does anyone know of a way to embed an html url within a mc, so that it plays within my shell and not as a popup?
Sorry for the long post. Hopefully I've explained myself well enough.
-Sandy
View Replies !
View Related
I Have A Menu Inside A MC, I Need To Access Other Scenes From The MC (Flash MX WinXP)
I have having great problems getting this to work.
I have a movie clip (called "menu") that has my menu inside it. Each button has the following AS:
Code:
on (release) {
_root.gotoAndPlay("contact", 1);
}
Now, in theory that will goto the scene "contact" - but it doesn't, it just sits there doing nothing.
Aparently there is something about a Tell Target, and I have tried using the Macromedia Support Centre, but it just confused me further.
I have Windows XP with Flash MX.
Any help will be much apppricated.
TE
View Replies !
View Related
Access Movie Clip Inside ScrollPane Component
How do you access a movie clip that's inside a scrollPane component? I'm not having any luck; I guess it's because the movie clip is not actually nested inside the scrollPane component, but is just linked to it.
Here's my code, which is in frame actions of the main timeline:
scrollPane1.box1._visible=false; //doesnt work
scrollPane1.box1._visible=false; //works
View Replies !
View Related
1087 Error From Trying To Access A Button Inside A Symbol
Hey All,
I've been getting a 1087 error with regards to my attempts to access a button inside a symbol which is being referenced by a ScrollPane Component.
The basic idea is for the user to click a button in the symbol scrollable symbol, that in turn affects a movie clip outside the symbol and ScrollPane. The code I am using is as follows.
Code:
// infoPaneMC is the movie clip outside the ScrollPane that I am trying
// to activate. In a perfect world, pressing the button below would
// cause it to slide into frame (or halfway through its timeline)
infoPaneMC.stop();
// scrolltest is the movie clip symbol referenced by the ScrollPane
// 1800_R_Button is the button inside scrolltest
scrollTest.1800_R_Button.addEventListener (MouseEvent.MOUSE_UP,startClip);
function startClip(e:MouseEvent) {
infoPaneMC.play();
}
// This code is what I am using to close infoPaneMC by playing it
// out from its halfway mark
infoPaneMC.addEventListener (MouseEvent.MOUSE_UP,startClip2);
function startClip2(e:MouseEvent) {
infoPaneMC.gotoAndPlay("infoPanePause");
}
However I keep getting the following error:
1087: Syntax error: extra characters found after end of program.
The line it refers me back to is:
Code:
scrollTest.1800_R_Button.addEventListener (MouseEvent.MOUSE_UP,startClip);
Any ideas?
Thanks!
Boz
View Replies !
View Related
Global Variable Access Inside Class Functions
Hi people,
I don't understand very well how does flash accesses global variables:
I want to create a news loading system which gets in real time a record from a database. I want to avoid loading all the records at once to avoid memory wasting. So, my idea is to first get all the records id to a array and then load them one by one.
I'm using the following code to get the id's:
mainurl = "http://192.168.1.2/beta/";
_global.idarray = new Array();
newsData = new LoadVars();
newsData.load(mainurl+"news.php");
newsData.onLoad = function(status) {
if (status) {
_global.idarray[0] = this.totalnews;
for (i=1;i<=this.totalnews;i++) {
_global.idarray[i] = this["news"+i+"Id"];
}
}
else {
trace ("Error loading data");
}
}
trace(_global.idarray[0]);
trace(_global.idarray[1]);
But in this last traces i get undefined. Why cant it access the global var inside the onload function? I have several problems with this kind of stuff.
Can anyone give me some lights here?
Thx
View Replies !
View Related
Access Array Values Modified Inside Function
I'm trying to access the 'names' array values from outside the function. The textbox 'txt1' displays the correct values, however the final line won't trace out any value for names[1] (not a problem with array length). I'm sure this is a scope issue, but thought declaring the names array outside of the function would allow for the values created in the function to be accessible outside of the function. Thanks in advance for any help!
Code:
test_xml = new XML();
test_xml.ignoreWhite = true;
test_xml.load("test.xml");
var email = [];
var names = [];
test_xml.onLoad = function(success){
if(success) {
for (var n = 0; n<test_xml.firstChild.childNodes.length; n++) {
var currentNode = test_xml.firstChild.childNodes[n];
names[n] = currentNode.attributes.name;
email[n] = currentNode.childNodes[2].firstChild.nodeValue;
}
for (var i = 0; i<names.length; i++) {
txt1.text += "Name: " + names[i] + "
Email: " + email[i] + "
";
}
}
else {
trace("Problem getting XML");
}
}
trace("Name is: " + names[1]);
View Replies !
View Related
Unable To Access Function From Inside A Loaded Movie...
Guys,
I am new to Actionscript. Up till now I have only used flash for animation. So hopefull I make sence...
I have a movie called Loader.
In loader I have a tooltip function (fillTip) which shows tool tip for items in that movie (works fine in loaders.swf).
Now I am loading another movie (movie.swf) inside loader. I want to access a function located in the loader.swf. Being this is a second movie that is loading, I can use trace to check my problem...
I have tried _root.fillTip and _global.fillTip...
Please advise,
Shrini
View Replies !
View Related
|