Nested MC's Troubles
Hi,
i've created a containerMC with ten MCs in it. There's an actionscript on the container for moving it on the stage. On each nested MC there is ActionScript as wel. On the nested MCs the as does not work?
How comes? How can i overcome this?
thx Genius
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-14-2004, 05:39 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash Animation Troubles In Nested Tables
http://www.concentric.net/~Gatienza/timelineproblem.htm
can someone please help me out? my animation does not appear right off the bat until i mouseover it. it is not a button, just a simple movie clip. it doesn't have this problem when it is in a table, but once it's in a NESTED table this happens. any help would be appreciated. is it something simple that i am overlooking?
thanks in advance,
jgatienza
Troubles With A Nested GotoAndPlay A Scene Call
I have a problem with a gotoAndPlay call that is driving me up the wall and back down it again. I think the problem is with the structure of how things are nested but I cannot figure out how to get around it. My scene (where the button is called from) is structured as follows:
Scene1
-- movie clip (motion tween)
----movie clip (holds all the symbols)
------ button1
button1 is supposed to go to another scene name that exists in this file but it is unfortunately not doing this.
ActionScript Code:
on (release){ _root.gotoAndPlay("Scene2", 1);}
If anyone has any thoughts, comments, or suggestions I would love to hear them.
Troubles With A Nested GotoAndPlay A Scene Call
I have a problem with a gotoAndPlay call that is driving me up the wall and back down it again. I think the problem is with the structure of how things are nested but I cannot figure out how to get around it. My scene (where the button is called from) is structured as follows:
Scene1
-- movie clip (motion tween)
----movie clip (holds all the symbols)
------ button1
button1 is supposed to go to another scene name that exists in this file but it is unfortunately not doing this.
ActionScript Code:
on (release){ _root.gotoAndPlay("Scene2", 1);}
If anyone has any thoughts, comments, or suggestions I would love to hear them.
Flex Nested Arraycollections And Nested Repeaters
I can't figure out how to get a dataProvider from a nested ArrayCollection. I'll try to provide as much code as possible without dumping my whole project in. If I miss something critical, let me know.
Here is the concept. Clients have Projects. Projects have Images. I want to show this relationship in a form. Displaying the list of Images for each Project is where I'm stumbling.
This is what it looks like in xml.
Code:
<data>
<client name="clientName">
<project name="project1">
<image name="image_1.jpg" />
<image name="image_2.jpg" />
<image name="image_3.jpg" />
<image name="image_4.jpg" />
</project>
<project name="project2">
<image name="image_1.jpg" />
<image name="image_2.jpg" />
</project>
</client></data>
Now, when I load the .xml in, I have custom classes for Clients, ClientList, Project, ProjectList, ImageList and I push all the xml data into that structure. Basically each of the list classes contains a 'list:ArrayCollection' value that contains the various items in that list as well as the functions to add and remove items in the list. The lists are what I use as dataProviders in the form.
Each Client object has a ProjectList that contains all the Projects for that Client. In turn, each Project has an ImageList that contains all the images for that project.
The populateForm below is triggered when a combobox changes. It receives the event with a client attached.
Code:
private function populateForm(event:Event):void{
//selectedClient becomes the
var selectedClient:Object = event.target.selectedItem;
/*this is easy enough. I already gave each client a name value and this displays it to the textfield in my form.*/
clientName.text == selectedClient.name;
/* this is also working. I'm using the 'list:ArrayCollection' of that client's projects as the dataprovider for the first repeater in my form */
projectRepeater.dataProvider = selectedClient.projects.list;
//imageRepeater.dataProvider = ?????
//skipping ahead to my mxml
<mx:Form>
<mx:FormItem>
<mx:VBox>
<mx:Repeater id="projectRepeater">
<mx:Panel width="500" title="{projectRepeater.currentItem.name}">
<mx:VBox width="100%">
<mx:Repeater id="imageRepeater">
<mx:List labelField="name" dataProvider="{????}"/>
</mx:Repeater>
</mx:VBox>
</mx:Panel>
</mx:Repeater>
</mx:VBox>
</mx:FormItem>
</mx:Form>
How do I set an appropriate dataProvider for the imageRepeater? The projectRepeater makes sense because I can layout all projects for each client. But the images are nested. How can I target them?
Referencing A Nested, Nested Movie Clip
Here's the setup.
let's say you have a movie clip called "parent" on the root timeline.
On frame 1 of the parent clip, you have another clip called "childA"
On frame 2 of the parent clip, you have a clip called "childB"
so, only childA is on frame 1, and only childB is on frame 2
also, let's say that both childA and childB each have a local function named "Add"
using dot syntax, you can call those functions from the root timeline:
_root.parent.childA.add(); or _root.parent.childB.add();
however, Flash only seems to be aware of those children that exist on the currently selected frame of the parent. In other words, if the current frame in the parent mc is 1, you can use parent.childA.add(); but not parent.childB.add();
Is there any way to be able to reference a child movie clip in a parent movie clip when the child is not on the currently selected timeline?
I can't put all the child clips on every frame, because I need to be able to print the entire parent movie clip (multiple frames, so each child can only exist in their own frames).
Thanks in advance for your help or insight!
Cheers!
Nested Shapes Vs. Nested Sprites In AS 3.0
Hello,
I'm trying to learn Actionscript 3.0 from the ground up. I am trying to figure out why I can't create nested shape objects in the manner that's demonstrated below w/ Sprite objects.
var container:Shape = new Shape();
When I change the below from a Sprite to a Shape I get this error:
"Call to a possibly undefined method addChild through a reference with static type flash.display:Shape."
var container:Sprite = new Sprite();
container.graphics.lineStyle(0,0xFF6600);
container.graphics.beginFill(0xFF3300);
container.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
container.graphics.lineTo(100, 0); // move to left 65 x and 0 y
container.graphics.lineTo(100, 100); // from 65 x to 20 y
container.graphics.lineTo(0,100); // 0 x to 20 y
this.addChild(container);
container.x = 140;
container.y = 140;
var box_1:Sprite = new Sprite();
box_1.graphics.lineStyle(0,0xFFFFCC);
box_1.graphics.beginFill(0xFFFF00);
box_1.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
box_1.graphics.lineTo(80, 0); // move to left 65 x and 0 y
box_1.graphics.lineTo(80, 80); // from 65 x to 20 y
box_1.graphics.lineTo(0,80); // 0 x to 20 y
container.addChild(box_1);
box_1.x = 10;
box_1.y = 10;
var box_2:Sprite = new Sprite();
box_2.graphics.lineStyle(0,0x92E9FE);
box_2.graphics.beginFill(0x92E9FE);
box_2.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
box_2.graphics.lineTo(60, 0); // move to left 65 x and 0 y
box_2.graphics.lineTo(60, 60); // from 65 x to 20 y
box_2.graphics.lineTo(0,60); // 0 x to 20 y
box_1.addChild(box_2);
box_2.x = 10;
box_2.y = 10;
Thanks,
Eric
How To Play Second Nested Mc After First Nested Mc Finishes?
Hi all,
I am very new to action script - I am sure there is a stupidly simple way to do this:
I have an mc named logoclip. Within logoclip, I have one mc (instance: logointro) nested in frame 1(label: logoin) and one mc (instance: logogrowth) nested in frame 2 (label:logogrow). After the first mc finishes I want the second mc on frame 2 to play. The first mc is tweened with actionscript with the final tween finishing after 132 frames.
I'm not sure what the best way is to do this. Any suggestions?
Cheers
Nested Shapes Vs. Nested Sprites In AS 3.0
Nested Shapes vs. Nested Sprites in AS 3.0
Hello,
I'm trying to learn Actionscript 3.0 from the ground up. I am trying to figure out why I can't create nested shape objects in the manner that's demonstrated below w/ Sprite objects.
var container:Shape = new Shape();
When I change the below from a Sprite to a Shape I get this error:
"Call to a possibly undefined method addChild through a reference with static type flash.display:Shape."
var container:Sprite = new Sprite();
container.graphics.lineStyle(0,0xFF6600);
container.graphics.beginFill(0xFF3300);
container.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
container.graphics.lineTo(100, 0); // move to left 65 x and 0 y
container.graphics.lineTo(100, 100); // from 65 x to 20 y
container.graphics.lineTo(0,100); // 0 x to 20 y
this.addChild(container);
container.x = 140;
container.y = 140;
var box_1:Sprite = new Sprite();
box_1.graphics.lineStyle(0,0xFFFFCC);
box_1.graphics.beginFill(0xFFFF00);
box_1.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
box_1.graphics.lineTo(80, 0); // move to left 65 x and 0 y
box_1.graphics.lineTo(80, 80); // from 65 x to 20 y
box_1.graphics.lineTo(0,80); // 0 x to 20 y
container.addChild(box_1);
box_1.x = 10;
box_1.y = 10;
var box_2:Sprite = new Sprite();
box_2.graphics.lineStyle(0,0x92E9FE);
box_2.graphics.beginFill(0x92E9FE);
box_2.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
box_2.graphics.lineTo(60, 0); // move to left 65 x and 0 y
box_2.graphics.lineTo(60, 60); // from 65 x to 20 y
box_2.graphics.lineTo(0,60); // 0 x to 20 y
box_1.addChild(box_2);
box_2.x = 10;
box_2.y = 10;
Thanks,
Eric
Edited: 05/20/2008 at 07:46:30 AM by clem_c_rok
Nested Shapes Vs. Nested Sprites In AS 3.0
Hello,
I'm trying to learn Actionscript 3.0 from the ground up. I am trying to figure out why I can't create nested shape objects in the manner that's demonstrated below w/ Sprite objects.
var container:Shape = new Shape();
When I change the below from a Sprite to a Shape I get this error:
"Call to a possibly undefined method addChild through a reference with static type flash.display:Shape."
var container:Sprite = new Sprite();
container.graphics.lineStyle(0,0xFF6600);
container.graphics.beginFill(0xFF3300);
container.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
container.graphics.lineTo(100, 0); // move to left 65 x and 0 y
container.graphics.lineTo(100, 100); // from 65 x to 20 y
container.graphics.lineTo(0,100); // 0 x to 20 y
this.addChild(container);
container.x = 140;
container.y = 140;
var box_1:Sprite = new Sprite();
box_1.graphics.lineStyle(0,0xFFFFCC);
box_1.graphics.beginFill(0xFFFF00);
box_1.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
box_1.graphics.lineTo(80, 0); // move to left 65 x and 0 y
box_1.graphics.lineTo(80, 80); // from 65 x to 20 y
box_1.graphics.lineTo(0,80); // 0 x to 20 y
container.addChild(box_1);
box_1.x = 10;
box_1.y = 10;
var box_2:Sprite = new Sprite();
box_2.graphics.lineStyle(0,0x92E9FE);
box_2.graphics.beginFill(0x92E9FE);
box_2.graphics.moveTo(0, 0); // start line @ 10._x and 0 Y
box_2.graphics.lineTo(60, 0); // move to left 65 x and 0 y
box_2.graphics.lineTo(60, 60); // from 65 x to 20 y
box_2.graphics.lineTo(0,60); // 0 x to 20 y
box_1.addChild(box_2);
box_2.x = 10;
box_2.y = 10;
Thanks,
Eric
Nested Shapes Vs. Nested Sprites In AS 3.0
Hello,
I'm trying to learn Actionscript 3.0 from the ground up. I am trying to figure out why I can't create nested shape objects in the manner that's demonstrated below w/ Sprite objects.
var container:Shape = new Shape();
When I change the below from a Sprite to a Shape I get this error:
1061: Call to a possibly undefined method addChild through a reference with static type flash.display:Shape.
Communicating From A Nested Clip To Another Nested Clip
I keep getting "TypeError: Error #1009: Cannot access a property or method of a null object reference." and I don't understand why.
What I am trying to do is to communicate from inside a movieclip nested in the main timeline to another movieclip nested on the main timeline. And I assume that this is why I am getting the error although I do not understand why or how to fix it.
more details and my code:
I have a menu nested in a movieclip on the main timeline that when activated creates a fog over the images in the background. A series of buttons appear that when clicked removed the fog and play individual movieclips nested in the main timeline.
I am trying to create a rollover that will preview the movieclips before you click on them and confirm your choice.
cutlery_btn.addEventListener(MouseEvent.MOUSE_OVER , onRollOverCutlery);
cutlery_btn.addEventListener(MouseEvent.CLICK, onClickCutlery);
function onRollOverCutlery(event:MouseEvent):void
{
MovieClip(root).cutlery_mc.gotoAndStop(10);
}
function onClickCutlery(event:MouseEvent):void
{
MovieClip(root).gotoAndPlay("cutlery");
MovieClip(root).menuTab_mc.visible = false;
MovieClip(root).fog_mc.play();
}
Thanks for your help!
MC Troubles
I have a few questions:
1) I have 3 MC's and 3 corresponding buttons. On the rollover of button "1" MC "1" needs to play(the trick is I want it to play to it's end no matter what else happens {rollout/release} then complete it's task ie goTo URL) this is the code I have for that as of now (tried many others but to no avail)
on (rollOver) {
gotoAndPlay ("left");
}
I was also advised to try:
on (rollOver) {
gotoAndPlay ("left");
if (left._currentFrame) {
play ();
}
}
2) Then at the end of the MC I want it to return to frame 1 on the main stage?
PHP Troubles
Ok, this is a bit of a weird problem. I'm useless at coding anyway, so you can imagine how I fare with PHP. However, I got both a 'mailing list' type thing as well as a 'comments' form working absolutely no problem. That is when tested offline in the stand alone flash player.
When I publish the file online the PHP wouldn't work for some reason. I have this code on the first frame:
Quote:
mailform = "http://www.domain.com/mailform.php";
action = "";
an input text box assigned the instance name 'vemail' and this code on a 'submit' button:
Quote:
on (release, keyPress "<Enter>") {
if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)) {
action = "Send";
loadVariablesNum("http://www.domain.com/mailform.php", 0, "POST");
vemail = "";
getURL("java script:NewWindow=window.open('http://www.domain.com/success. htm','newwin','width=240,height=200,top=0,toolbar=
No,location=No,scrollbars=No,status=No,resizable=N
o,fullscreen=No'); NewWindow.focus(); void(0);");
} else {
vemail = "incorrect entry!";
action = "";
stop();
}
}
This is the PHP script as well:
Quote:
<?
$adminaddress = "email";
$siteaddress ="http://www.domain.com";
$sitename = "site";
$date = date("m/d/Y H:i:s");
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
IF ($action != ""):
mail("$adminaddress","subject",
"new member: $vemail
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
mail("$vemail","thank you for visiting $sitename!", "Hi $fname
Blah Blah Blah
$sitename
$siteaddress","FROM:$adminaddress");
ENDIF;
?>
Like I said, I am pretty awful at coding but this seemed to work when I was offline, so I can't work out why it doesn't work online. Presumably there is no problem with the server that the PHP file is uploaded to seeing as though it worked before.
Can anyone help?
telekin:
SWF To AVI Troubles...
I'm a TOTAL newb, so I hope I'm just not doing something right...
I'm trying to convert the SWF files from this page into AVI files so I can burn them onto a video CD or a DVD.
My problem is that no matter what program I try, when I export the movie, it does NOT save the sound at all...
Anyone know what I may be doing wrong???
Is there a program that will convert the file for me in whole???
Thank you very much for your time.
-EB64
SWF To AVI... Troubles... Help... Please...
Hey, I've got this problem, see if you can give me a hand.
I made an animation in Flash, that has several movie clips, with other movie clips inside, and so on (I'll explain better so you can understand: they're some animals that move, and their eyes (that blink) are another movie clips inside of the first movie clip). When I publish it as an .SWF, it works as expected, but if I export it as an .AVI (the animation will come out in video, and the person that's going to edit it asked me for that specific format), the movie clips don't move, like it is only reading the main timeline. Do you understand me? The only movements that come out are the ones that happen in the main timeline. The others movie clips stay still in the first frame. oes anybody know what's going wrong and how can I export that .AVI? Thank you.
Dns Causes Troubles?
Hi
In this site I made, there is a popup function that's allow to see
pictures. When I click on the buttons, it tries to open a new page
but not a popup.
Since I applied a dns management package and cloaked the site's name, that function doesn't work anymore( and it used to ).
The pictiures are in a file that's on the same level that the only
.fla wich contains the all site.
function popCenter (url, nom, largeur, hauteur) {
getURL ("java script:window.open('http://www.webcold.com/MahalR" +url +"','" +nom +"','width=" +largeur +",height=" +hauteur +"scrollbar=yes,top='+((screen.height/2)-(" +hauteur/2 +"))+',left='+((screen.width/2)-(" +largeur/2 +"))); void(0);");
}
On the buttons itself:
on (release){
_root.popCenter("popup/IMG_1393.html", "gpopup", "410", "307");
}
If you want to have a look, go http://www.mahalrayan.com ,in the photogallery section and click on the pictures.
Dns Causes Troubles
Hi
In this site I made, there is a popup function that's allow to see
pictures. When I click on the buttons, it tries to open a new page
but not a popup.
Since I applied a dns management package and cloaked the site's name, that function doesn't work anymore( and it used to ).
The pictiures are in a file that's on the same level that the only
.fla wich contains the all site.
function popCenter (url, nom, largeur, hauteur) {
getURL ("java script:window.open('http://www.webcold.com/MahalR" +url +"','" +nom +"','width=" +largeur +",height=" +hauteur +"scrollbar=yes,top='+((screen.height/2)-(" +hauteur/2 +"))+',left='+((screen.width/2)-(" +largeur/2 +"))); void(0);");
}
On the buttons itself:
on (release){
_root.popCenter("popup/IMG_1393.html", "gpopup", "410", "307");
}
If you want to have a look, go http://www.mahalrayan.com ,in the photogallery section and click on the pictures.
Mac Os + MX Troubles
Hi ,
I’ve been downloading tons of movies from the flash archive, i was looking for some kind of nice, simple mouse follow but with flash MX i am not able to open any .fla .
I am using Mac os 9.01 on a G3 eand it gives me ERROR -39.
I also try to change the Type of file with ResEdit, the icon change but i got always the same message. -39.
Any mac user got any clue ?
thanks!
Pop Up Troubles
Okay, so I have this flash site I'm making for school. The main site loads into a pop up window that I made with this javascript that I put into a welcome page:
SCRIPT LANGUAGE="JavaScript"
function popup() {window.open('intro.html','','toolbar=no,location= no,directories=no,status=no,menubar=no,scrollbars= no,resizable=no,width=504,height=360,left=0,top=0' );}</script>
It was originally working okay, but I made some changes and republished the pop up html and swf files. Now the pop up window opens okay, but the flash movie is shifted to the bottom right, cutting off some of the movie. I tried placing the flash movie in differant places within the html file ie.Top, Absalute middle etc. but nothing has worked.
Thanks.
MC Troubles
Hi Dudes & Dudettes!
I am hoping that one of you flash bods can help me out with this MC problem that I can't get my head around!?
I have a movie that I am working and in theory it should be quite simple. I have a MC(screen) of a display screen that part-rotates on a timeline of 100 frames (24fps) frame 1 shows a 3/4 left side on view of the screen - frame 50 shows a flat front on view - and frame 100 shows a 3/4 right side on view. This movie clip is then put into another timeline on a 750width stage where the MC-Screen starts on the far left hand side of the stage and moves to the exact centre on frame 50 and finishes on the far right of the stage on frame 100 all positions on the stage correspond to the rotation amount in the MC-screen.
What I want to do is have 10 screens placed at intervals across the stage and want the MC-screen to start playing from different frames of the MC-screen ie: the first screen plays from frame 1 of it's timeline then the next screen will always play from frame 10 etc... so it gives the effect of continuous movement by the screens. I have tried to duplicate the MC-screen and then paste the first 10 frames at the end of the timeline for the MC-screen so as frame 10 becomes frame 1 but it seems to eat the memory up.
How do I do it??? someone out there must have some idea......
......please!!!!
Cheers
Diga
Mc Troubles
Hi Dudes & Dudettes!
I am hoping that one of you flash bods can help me out with this MC problem that I can't get my head around!?
I have a movie that I am working and in theory it should be quite simple. I have a MC(screen) of a display screen that part-rotates on a timeline of 100 frames (24fps) frame 1 shows a 3/4 left side on view of the screen - frame 50 shows a flat front on view - and frame 100 shows a 3/4 right side on view. This movie clip is then put into another timeline on a 750width stage where the MC-Screen starts on the far left hand side of the stage and moves to the exact centre on frame 50 and finishes on the far right of the stage on frame 100 all positions on the stage correspond to the rotation amount in the MC-screen.
What I want to do is have 10 screens placed at intervals across the stage and want the MC-screen to start playing from different frames of the MC-screen ie: the first screen plays from frame 1 of it's timeline then the next screen will always play from frame 10 etc... so it gives the effect of continuous movement by the screens. I have tried to duplicate the MC-screen and then paste the first 10 frames at the end of the timeline for the MC-screen so as frame 10 becomes frame 1 but it seems to eat the memory up.
How do I do it??? someone out there must have some idea......
......please!!!!
Cheers
Diga
{Mod Edit: Moved to General Help- SJT]
For (i=1; I<17; I++) Troubles
Here is some code I'm writing that I'm having some big problems with. First, for the "text1" variable on line 7, how do I write the "unescape(title1)" part so that it goes: title1, title2, title3, etc.? Second, even bigger problem; all of my variables in this act like they are all 17, not 1,2,3,4,5,6 etc. Finally, how do I handle changing info like "rocksDescription" mindway down the code and, "QS164_Rocks.jpg" at the bottom?
Code:
title1 = "Rocks%99"
title2 = "Eggs%99"
title3 = "Cars%99"
//etc.
for (i=1; i<17; i++) {
_root["Btn"+i].btn.onRollOver = function() {
text1 = unescape(title1);
};
_root["Btn"+i].btn.onRollOut = function() {
text1 = "";
};
_root["Btn"+i].btn.onRelease = function() {
_root.attachMovie("ButtonCoverMC", "ButtonCoverMC", 80);
_root["Btn"+i].gotoAndStop(2);
setProperty("_root.ButtonCoverMC", _x, i*23+209);
setProperty("_root.ButtonCoverMC", _y, 470);
_root.ButtonCoverMC.coverText = i;
_root.Description.copy.attachMovie("rocksDescription", "", 2);
_root.Description.gotoAndPlay(2);
_root.attachMovie("ProductFadeInMC", "ProductFadeInMC", 300);
setProperty("_root.ProductFadeInMC", _x, 202);
setProperty("_root.ProductFadeInMC", _y, 189);
loadMovie("products/QS164_Rocks.jpg", "_root.ProductFadeInMC.productHolder");
};
};
text 1
XML Troubles, Please Help
Hey all;
I'm having troubles getting my xml data to display correctly, any suggestions?
Here's what I've got so far:
- An MC with a scrollpane on the stage.
-In the library, a MC called contentMC.
-Inside contentMC is an empty MC called imgHolder (for holding the jpgs) and a dynamic text field named infoText.
-An XML file named catalog.xml.
So I've been able to adjust my xml nodes to get to my info, but it wont display right. For one thing, it won't display the jpgs unless there is a dynamic text field in contentMC (which I find wierd). And secondly, I can't figure out how to position the jpgs & text so they don't overlap each other.
Here is the code I've got loading in the xml:
Code:
//create new XML object & load from external source
albumXML = new XML();
xmlDoc = "catalog.xml";
albumXML.ignoreWhite = true;
albumXML.onLoad = checkXMLStatus;
albumXML.load (xmlDoc);
//Checks the success of the loading
function checkXMLStatus(success) {
if (success) {
//Build the catalog
buildMenu();
} else {
trace (" Did not load ");
}
}
stop();
and this is the code I've got manipulating the xml data:
Code:
function buildMenu() {
theDepth = 100;
this.createEmptyMovieClip ("con", 10);
nodeCount=albumXML.firstChild.firstChild.childNodes.length;
for (u = 0; u < nodeCount; u++) {
//Build the content listing
buildContent();
} //Attaches the clip of items, to the Macromedia scrollpane component, which has an instance name of "catalogPane".
albumPane.setScrollContent (con);
}
function buildContent(){
theJpg = albumXML.firstChild.firstChild.childNodes[u].attributes;
theInfo = albumXML.firstChild.firstChild.childNodes[u].childNodes;
theName = "item_" + u;
con.attachMovie("contentMC", theName, theDepth++, {_y :350 * spacing});
con[theName].imgHolder.loadMovie(theJpg);
con[theName].infoText.text = theInfo;
spacing++;
}
stop();
...and this is the XML data:
Code:
<catalog>
<albums directory="albums">
<imageNode jpegURL="alb01_img00.jpg">Description of album 1</imageNode>
<imageNode jpegURL="alb01_img01.jpg">Description of album 2</imageNode>
<imageNode jpegURL="alb01_img00.jpg">Description of album 3</imageNode>
<imageNode jpegURL="alb01_img01.jpg">Description of album 4</imageNode>
</albums>
<singles directory="singles">
</singles>
<videos directory="videos">
</videos>
</catalog>
So how do I get the text to display correctly? Right now I get the word "null" in the text box when I test.
And how do I get it all to line up correctly?
Thanks for any and all help.
A Few Troubles
1) I want a projector file to open in Full Screen, so it doesn't show the Flash file menu or title bar. How do I do this?
2) I want to have a print function inside the projector so I don't have to use Flash Player's File->Print, and so I have control over what is being printed. Could someone please link me to a relevant tutorial?
3) When I set the Alpha of a movie clip to 0, if the movie clip has other movie clips inside of it then they are not made invisible. Do I have to set all of the inside objects to be invisible, one by one, or is there another way?
Thanks
XML Troubles. Its A Bit [U]ODD[/U]
Hi Everybody, Im Using Flash to read Questions from an XML file. The trouble Im having is, I am reading questions from an XML file into Flash variables, but the questions only load into the variables if the nodes are odd numbers!!! Ive got it working with the odd numbers, what I was wondering if anybody new why this happens and if possible how to fix it?.
Troubles With 3D
I am as as
I'm a real newby, as you should be in this forum. I've got this download, Swift 3D, I Think, at least something with 3D. My problem:
How to attach, for example, spinning wheels to a car, wiggly eyes to a face, that sort of thing.
Please answer this one question, I soy to anyone who knows this stuff( or is it only allowed for newbies to answer here? )
If someone reacts, THANK YOU
Troubles With This
trying to do something fairly simple, just want to have a root function define onRollOver,onRollOut, and onEnterFrame for a bunch of movieclips
PHP Code:
//frame actions in root
function prepare() {
this.onRollOver = function() {
if (this._currentframe<this._totalframes) {
this.go = true;
}
_root.popup("TV", this);
};
this.onRollOut = function() {
this.go = false;
_root["mytext"].removeTextField();
_root.popupmc.removeMovieClip();
_root.pointer.removeMovieClip();
};
this.onEnterFrame = function() {
this.go ? play() : prevFrame();
};
}
PHP Code:
//actions in mc
onClipEvent(load){
_root.prepare(this);
}
Pop-up Troubles...
i've tried to make a site that has a main page which has a button on it that will launch the actual website, in its own window. I had it working but i accidently deleted the fla file of my working version, and now that i have had to redo it i cant seem to get it to work again! So i was wondering whats wrong with my code? :
on (release) {
getURL ("javascript:NewWindow=window.open('http://www.geocities.com/flashsaga/testsize.html','Welcome To Flashsaga','width=985,height=580,left=15,top=50,to olbar=No,location=No,scrollbars=No,status=No,resiz able=No,fullscreen=No');", "NewWindow.focus(); void(0);");
}
incase you want to see what that code ends up doing you can find it here:
http://www.geocities.com/flashsaga/main.html
IF Troubles
I have a large if statement being worked through. This is the part that is causing the trouble.
(this is one section of a much longer code)
code:
} else if (variablea == 5 or 6 && variableb == 2002 && variablec == 49 && variabled == 1 or 4 or 5 or 6) {
variablef = blah1;
} else if (variablea == 5 or 6 && variableb == 2002 && variablec == 49 && variabled == 2 or 3) {
variablef = blah2;
}
Now, no matter what I enter for variablec or variabled I always end up with variablef becoming blah1.
variablef should become blah2 if variabled is 3 or 4.
Hope this doesn't sound too confusing.
Pop Up Troubles
I am having troubles where some of my pop ups have stopped working. Instead of the pic appearing in a new window at the specified size, the new window just says 'untitled' and is regular size. I have this code on the button:
Quote:
on (release) {
getURL("javascript: MM_openBrWindow('brace1.html','loading','width=300 ,height=450')", "_blank");
}
Is there any hidden code in the html file/s that I may have overwritten, or can you think of any other reason why they are all not working?
Pop-up Troubles
hi everyone. I'm having trouble with some pop-ups. THey work fine on firefox but wont pop in IE6, is there anything else i could add to the code to make it pop in IE?
i used the same code in this tut.
http://www.kirupa.com/developer/flas...pup_window.htm
please help
Im using flash 8
[F8] Lag Troubles
Hey everyone!
I am almost done with my game, you can view the beta version here http://peejaroni.com/drawman.aspx
As you can see if you play for a while you will experience a bunch of lag. I'm not going to post the .fla in case someone tries to steal it, but I will post the script I think it is lagging at. I believe that the missiles keep duplicating, and the for loops that detect hitTests end up working too hard when they need to calculate over 150 numbers. I tried to clear out the numbers every X amount of shots, but then the hitTests wouldn't work at all.
here is my duplication code...
_root.z --
_root.j++;
duplicateMovieClip("_root.rline", "rline"+_root.j, _root.z);
eval("_root.rline"+_root.j)._x = heroman._x;
eval("_root.rline"+_root.j)._y = heroman._y;
Here is my hitTest code
for (o=1; o<=_root.j; o++) {
if (this.hitTest(eval("_root.rline"+o))) {
if (eval("_root.rline"+o)._currentframe != 1) {
this.gotoAndPlay(2);
if(_root.ten == true){
_root.refy = true}
}
}
}
Thanks for your help.
ps. if you find any other bugs or problems or comments in the game please post them too.
Swf Troubles
I am making a game, everytime I export the game to an swf the controlls such as enter and arrow keys dont work. But then does work when I use the test movie funtion in my flash animator. Anyone know what to do, or how to make it work.
XML Troubles
Hello there,
i'm trying to make a photo gallery using kirupa tutorial http://www.kirupa.com/developer/mx2004/thumbnails.htm, but i tried to make this gallery with categories, so i made XML file like this
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<gallery>
<galleryName id = "Schools">
<images>
<pic>
<image>images/1.jpg</image>
<description>Hello</description>
<thumbnail>thumb/1.jpg</thumbnail>
</pic>
<pic>
<image>images/2.jpg</image>
<description>Hi</description>
<thumbnail>thumb/2.jpg</thumbnail>
</pic>
<pic>
<image>images/3.jpg</image>
<description>Hey</description>
<thumbnail>thumb/3.jpg</thumbnail>
</pic>
</images>
</galleryName>
</gallery>
and traced galleryname
Code:
galleryName= xmlNode.childNodes[i].attributes.id;
but when i trace image using this code in flash
Code:
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
it gives me null!!
Can you have a look?
Thanks!
Xml Troubles
i've been working with xml and i have also problems with it!!! i'm a beginner with this language...
i just don't understand and don't know how to import to flash special characters such as "ç" "á" "ã"... can anyone tell how can i import to flash this characters???
thanks for helping me
jinhos
Var Troubles
hey guys, so heres the scenerio:
Initially get the y positoion of _root.whiteBox.topTitles.titles.panel and store it in an variable called
titleY.
Then when each button is rolled off it will return to the titleY position. Either the one set at the start of the movie or when one of the buttons is pressed.
When each button is pressed it will set the titleY varible to a new number defined in the on (release) action. e.g: titleY = 140;
This is what I want to do, but what seems to be happening is something...I really don't know, I'm still kinda new and this stuff.
Mpg Troubles
Why is that when I import an mpg movie and make sure the "import sound" is checked, the audio on the mpg still does not work?? I have tried every import variation and nothing works.
MC Within An MC Troubles
When the game starts the MC playScreen displays because a variable is at 0. The playScreen MC consists of two other Movieclips, one Graphic background and one play button called playBTN.
Once you hit the playBTN a loop is executed to fill the monOnScreen variable (the one that was at 0 before) to the level*5 (so 5 would be the max at the first level). The monOnScreen represents the number of enemies on the screen. When you hit an enemy it subtracts from the monOnScreen variable.
When the monOnScreen variable reaches 0 what is supposed to happen is that it will turn on the playScreen variable so that you can press play and start a new level. I'm using a movieclip's .onEnterFrame to constantly be checking the monOnScreen variable.
The problem with this is that when it comes up after the first time the play button won't work. The first time it loads, it works perfectly but the second time it doesn't work. I've tried checking the monOnScreen variable every time you hit an enemy but still the same result (the play button not working).
Here's what I've written.
ActionScript Code:
//Play Button
playScreen.playBTN.onRelease = function() {
trace("The Play Button is working");
//It needs to create the monsters
for (a=0; a<=level*5; a++) {
duplicateMovieClip(_root.enemy_mc, "enemy"+a, monDepth);
setProperty("enemy"+a, _x, 580);
setProperty("enemy"+a, _y, Math.round(Math.random()*300)+10);
_root.monOnScreen++;
_root.monDepth++;
playScreen.gotoAndStop("off");
trace("A is "+a);
}
};
//Checking to see if there are any monsters left
thing_mc.onEnterFrame=function(){
if (_root.monOnScreen == 0) {
//There are no monsters so start up a new level
_root.level++;
trace("The new level is "+_root.level);
_root.playScreen.gotoAndStop("active");
} else {
//Do nothing
}
}
Everything is named correctly (I know this because it works when it first comes up) it's just that the play Button doesn't work the second time it pops up.
Anyone have any ideas?
Xml Troubles
I have created a xml file with a list of images and have the xml playing correctly in flash. The problem I am having is when someone clicks on a navigation menu, I want the xml file to be replaced with another one. Is there any way to do that? I want to keep the new XML file the same name so that my array and load functions are the same.
I have asked around the forums and have searched the forums and I just am not having much luck.
Thanks!
Troubles..
Hi to all,
this code is pretty code until the line:
this[newnode].enode._xscale=scale;
I know that this code is scaling a MovieClip . What I can't understand is the enode istance.
Any of you could make it clearer?
newnode="node"+String(cnt);
this.attachMovie("target",newnode,cnt);
this[newnode]._x=x;
this[newnode]._y=y;
// scale the nested green node, not the crosshairs
this[newnode].enode._xscale=scale;
this[newnode].enode._yscale=scale;
this[newnode]._rotation=random(90);
// node will never become more than half opaque
this[newnode]._alpha=50;
etc
PS I downloaded this code from http://www.levitated.net/daily/levAttractorSets.html
Thanks
XML Troubles
I am having troubel with my XML Socket. I need to set it so that I can access XML on a server other than the host. I have looked into the policty files but cannot seem to make them work. Anybody have any experience with this?
Var Troubles
hey guys,
well I have a frame that has a variable named language and it's value will depend on the button clicked.
ActionScript Code:
var language:String;enterBtn.onRelease = function() { language = "eng"; gotoAndPlay(14);}
now on frame 23 I have
ActionScript Code:
stop();_root.container.unloadMovie("swf/splash.swf");if (language == fr) { trace("selected language is french"); _root.container.loadMovie("swf/aboutFr.swf");}else if (language == eng) { trace("selected language is english"); _root.container.loadMovie("swf/aboutEng.swf"); } trace(language);
my problem is that no matter what the language is it won't go in any of the if statements, nothing gets traced except the last trace which tells me what language has been selected and that works perfectly.
I can't seem to find the problem, can someone please help me out
XML/MC Troubles
Hi peoples, I'm having trouble outputting data from xml with movieclips, basically it only ouputs a single movieclip when it should be outputting three. I think its because I'm using attachmovie or something. Any help would be appreciated, heres the code:
Code:
var spacing = 24;
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.text = raw_text;
}
function doit(portfolio_xml){
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i < portfolioPictures.length; i++){
var currentPicture = portfolioPictures[i];
if(i == 0){ ix = (i - 1); var currentThumb_mc = _root.port.attachMovie("port_item", "thumbnail_mc"+i,this.getNextHighestDepth());
}else{ var currentThumb_mc = duplicateMovieClip("thumbnail_mc"+ix, "thumbnail_mc"+i,this.getNextHighestDepth());}
currentThumb_mc._y = spacing;
spacing = spacing + 49;
currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.thumb_container._x += 27;
currentThumb_mc.num.text = i + 1;
currentThumb_mc.client.text = currentPicture.attributes.client;
currentThumb_mc.description = currentPicture.attributes.description;
}
}
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
doit(this);
}
portfolio_xml.load("portfolio.xml");
AIR Troubles Me Again
As senocular had told me yesterday, that AIR is just a runtime and .air file is just a package-up of a group of assets.
so i made a swf and assign it as the root of the air application and then package it directly from Flex Builder 3 without mxml-compiling.
But with only one single swf, I cannot handle the stage.window.startMove and close etc.
I write in Flash CS3 this code:
ab_mc.addEventListener(flash.events.MouseEvent.MOU SE_DOWN, go);
function go()
{
stage.window.startMove();
}
but the Flash CS3 just tell me that there is not a "window" property.
So... If I want to develop some cute, transparent AIR projects, I have to make the swf compiled from MXML but not just Flash CS3 IDE ?
Anyone can give me a more detail instructions?
E4X Troubles
I originally posted this in the flash cs3 thread but I think it belongs here, sorry for the dupe!
I have an XMLList in the format:
Code:
<node>
<inner>
<item att="blue">
<item att="red">
<item att="green">
</inner>
</node>
<node>
<inner>
<item att="orange">
<item att="blue">
<item att="yellow">
</inner>
</node>
...
and I would like to return all nodes that have an attribute of a given value. For example if given "blue" I would want a return of an XMLList containing both nodes where "orange" would just return the second node. As far as I can figure it would be something like
Code:
myXMLList.(node.inner.*.@* == "blue");
but his does not work. If I name the attributes differently on every 'item' node it does work. I know I'm doing something wrong but can't pinpoint it. Is it possible to do this in a short syntax or does this require looping? Thanks in advance!
AS3 Troubles
I'm very new to Flash and AS3, but I'm getting by after completing Todd Perkins' training book.
I've come across my first obstacle that I'm not able to solve.
I've created a simple animation.
Here is the basic skeleton:
Main Timeline:nested movieclip:multiple nested movieclips.
I have a button on the main timeline to control one of the movieclips in the 'multiple nested movieclips' branch. The code I have in place is :
stop();
function stopbiomovie(event:MouseEvent):void
{
bio_mov.gotoAndStop(1);
}
function playbiomovie(event:MouseEvent):void
{
bio_mov.gotoAndPlay(1);
}
bio_but.addEventListener(MouseEvent.MOUSE_OVER, stopbiomovie);
bio_but.addEventListener(MouseEvent.MOUSE_OUT, playbiomovie);
where bio_mov is the movieclip I want to control. The first nested movieclip is in a keyframe on frame 1 with just a stop(); code in frame 1. When the movieclip finishes, I have code in place to advance the maintimeline to frame 2 and the movieclip remains, looping on its final frame. Everything runs smoothly ... until I add the above code in frame 2. When I add this code and attempt to play the project, the first nested movieclip just skips through, and keeps doing so. No button control. I get the following error messages:
1120: Access of undefined property bio_mov.
1120: Access of undefined property bio_mov.
1120: Access of undefined property bio_but.
1120: Access of undefined property bio_but.
with the following sources respective:
bio_mov.gotoAndStop(1);
bio_mov.gotoAndPlay(1)
bio_but.addEventListener(MouseEvent.MOUSE_OVER, stopbiomovie);
bio_but.addEventListener(MouseEvent.MOUSE_OUT, playbiomovie);
Okay, I hope this is a thorough enough description of the problem and what I'm trying to accomplish. Any help would be great. Thanks.
XML Troubles
I am having troubel with my XML Socket. I need to set it so that I can access XML on a server other than the host. I have looked into the policty files but cannot seem to make them work. Anybody have any experience with this?
XML Troubles
Hi Im new to this site Im ok with flash but my skills are very basic...ok heres my problem hope someone can help.
Basicly I want to use a thumbnail style left right pic scroller as a sort of menu bar for a site, now Ive edited the layers etc to get the look I want but my problem comes when I host the swv file on a server i have it placed in a folder along with the photos folder wich includes the XML file.
Now when I load the thumnail viewer via the server link it runs fine But when I try an place the server link into say another sites flash object container it loads the swv but fails to find the XML.
Now Ive changed the action link in flash cs3 to go to the server XML folder link and still no joy.
So basically what Im saying is can you host the swv gallery on one server and use the server swv link to place the same gallary on another site that just has a flash playing object ?
please help.
p.s sorry If I've placed this in the wrong place.
|