Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Loading Swf File To A Certain Spot



I'm using loadmovienum to drop a swf file menu into a presentation, but I can't seem to put it into the location I'd like. How can I make this happen?



Adobe > ActionScript 1 and 2
Posted on: 12/23/2006 12:57:17 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] ActionScript Challenge. Can Anyone Spot The Bug In This B#$@y File?
I'm having a problem with the attached template. There's seems to be one simple bug which is preventing the second, third and fourth swf to load correctly.
Here's a summary of how I structured the files.
Can anyone help???

I want to load this template into my frontpage.fla file 4 times.
Template1, 2, 3 & 4.swf are exaclty the same files. The code in all of them (as well as the variables and name of instances) are exacly the same.
I'm loading all 4 swfs on level1 on my frontpage.fla.

The problem I'm having is that the first templated (doesn't matter the order) loads fine however the other 3 only load 2 of the 13 menu options.
There's clearly some code left over in the main file once the first one is loades which is preventing the other 3 to load properly.
I don't know if I need to add some code to fix this on the frontpage.fla or need to add/fix something on the template file.

I'm not an ActionScript wiz and I'm using a template so I really need a hand here.
Any help would be appreciated.

I'm attached the files for your reference. Test them individually and loaded from the frontpage.swf and you'll see what I'm talking about.
It's a mistery to me why this is happening.

Please give me a hand.

Tks
danirob

[Q] Something Wrong With Frame 1 Of This File Which I Cannot Spot...
Something is really weird and I cannot spot where the problem is...

I have a movieClip called target_mc on the main timeline... Inside that movieClip, I have four frame animation where there are aim1_mc and aim2_mc on each frame...
I also have a for loop that hides aim1_mc on all the frames... It works fine on the first loop, but I see the aim1_mc of the frame 1 from the second loop...

ActionScript Code:
this.target_mc.onEnterFrame = function ()
{
        for (var i:Number = 1 ; i < 2 ; i++)
        {
            trace(this._currentframe + " :: " + "i = " + i);
            this["aim" + i + "_mc"]._alpha = 0;
        }
}
Can anybody spot why I am keep seeing the aim1_mc on frame 1???

Also, if I trace this._currentframe, it gives me 2, 3, 4, 5 rather than 1, 2, 3, 4... Does anybody know why???

FYI, I am working on FMX 2004 with this one, but I get the same result on F8...

Jump To A Specific Spot In XML File
Hi all!

I've got a little problem with my XML gallery. I want to jump to a specific spot in my XML file - when I click a button, it should jump to picture number 10.

Here is the code:
--------------------------------------------------------------

ActionScript Code:
#include "mc_tween2.as"Stage.scaleMode = "noScale";//import flash.display.BitmapData;var tile:BitmapData = BitmapData.loadBitmap("pattern");this.beginBitmapFill(tile);this.lineTo(Stage.width, 0);this.lineTo(Stage.width, Stage.height);this.lineTo(0, Stage.height);this.lineTo(0, 0);this.endFill();//function loadXML(loaded) { if (loaded) {  xmlNode = this.firstChild;  image = [];  description = [];  total = xmlNode.childNodes.length;  for (i=0; i<total; i++) {   image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;   description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;  }  proxImg (); } else {  content = "file not loaded!"; }}xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load("images.xml");//var nId:Number = -2;var nIm:Number = 0;//desc_txt.html = true;desc_txt.autoSize = "left";total_txt.html = true;total_txt.autoSize = "right";//function proxImg ():Void { if (nId == image.length - 1) {  trace ("end"); } else {  nId += 1;  nIm += 1;  _root.attachMovie ("img_mc", "img_mc" + nIm, nIm + 1);  eval (_root["img_mc" + nIm])._x = 37;  eval (_root["img_mc" + nIm])._y = 81;  _root.alphaTo (100, 0, "linear", 0, function () {   eval (_root["img_mc" + nIm]).mcl.loadClip (image[nId], eval (_root["img_mc" + nIm]).alvo_mc);  });  desc_txt.htmlText = (description[nId].toUpperCase ());  desc_txt._alpha = 0;  desc_txt.alphaTo (100, 1);  //  atual = addZero ((nId + 1), 2);  total = addZero (image.length, 2);  total_txt._alpha = 0;  total_txt.alphaTo (100, 1);  total_txt.htmlText = atual + "<font color='#000000'>" + "/" + total + "</font>"; }}//function prevImg ():Void { if (nId <= 0) {  trace ("end"); } else {  nId -= 1;  nIm += 1;  _root.attachMovie ("img_mc", "img_mc" + nIm, nIm + 1);  eval (_root["img_mc" + nIm])._x = 37;  eval (_root["img_mc" + nIm])._y = 81;  _root.alphaTo (100, 0, "linear", 0, function () {   eval (_root["img_mc" + nIm]).mcl.loadClip (image[nId], eval (_root["img_mc" + nIm]).alvo_mc);  });  desc_txt.htmlText = (description[nId].toUpperCase ());  desc_txt._alpha = 0;  desc_txt.alphaTo (100, 1);  //  atual = addZero ((nId + 1), 2);  total = addZero (image.length, 2);  total_txt._alpha = 0;  total_txt.alphaTo (100, 1);  total_txt.htmlText = atual + "<font color='#000000'>" + "/" + total + "</font>"; }}//function addZero (n, q):String { var str = Math.pow (10, (q - n.toString ().length)).toString ().substr (1) + n; return str;}//proxImg ();//prox_bt.onRelease = proxImg;prev_bt.onRelease = prevImg;//prev_bt.onRollOver = prox_bt.onRollOver = function () { this.alphaTo (100, 1);};prev_bt.onRollOut = prox_bt.onRollOut = function () { this.alphaTo (75, 1);};//contact_mc.onRollOver = function () { this.colorTo(0x9d5b14, 0.1, "linear");};contact_mc.onRollOut = function () { this.colorTo(null, 0.5, "linear");};


-------------------------------------------------------------

Here is the XML code from images.xml
-------------------------------------------------------------

Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>art/test2.jpg</image>
<caption>Sky is falling</caption>
</pic>
<pic>
<image>art/test.jpg</image>
<caption>Urban</caption>
</pic>
</images>
---------------------------------------------------

Hope you can help me? And understanding what I'm trying to explain ..hehe!

Loading Movie To Particular Spot
I am trying to load a movie clip into the time line and have it show at a particular spot on the stage

this is the code i am using

Code:

_root.createEmptyMovieClip("mc", _root.getNextHighestDepth());
mc.loadMovie("a1.swf"{_x:484, _y:45.3});
This is the error that I am getting



**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: ')' or ',' expected
mc.loadMovie("a1.swf"{_x:484, _y:45.3});

Total ActionScript Errors: 1 Reported Errors: 1



I really do not want to have to use a movieclip load but....... loading straight to x,y just seems like it would be easier (if i could get it to work)

thanks
Jess

Loading Movie To Particular Spot
I am trying to load a movie clip into the time line and have it show at a particular spot on the stage

this is the code i am using

Code:

_root.createEmptyMovieClip("mc", _root.getNextHighestDepth());
mc.loadMovie("a1.swf"{_x:484, _y:45.3});
This is the error that I am getting



**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: ')' or ',' expected
mc.loadMovie("a1.swf"{_x:484, _y:45.3});

Total ActionScript Errors: 1 Reported Errors: 1



I really do not want to have to use a movieclip load but....... loading straight to x,y just seems like it would be easier (if i could get it to work)

thanks
Jess

Loading Movie In Precise Spot?
[Originally posted as a reply to another msg]

When using loadmovie, how do you make sure that the new movie appears in the right spot?

Here's what I did, and the problem I am having:

I created a 550 X 400 movie with a 100 X 100 pixel MC named "placeholder" in it. The parent movie has a button which replaces "placeholder" with an external movie, like this:

on (release) {
loadMovie ("externalmovie.swf", "placeholder");
}

I made "externalmovie.swf" 100 X 100 pixels to ensure that it would replace "placeholder" perfectly, but that is not happening. "Externalmovie.swf" loads up way off-center of the original "placeholder". The center points of all my MCs appear to be correct.

What's going on here?

Loading A Movie Into A Specific Spot
What is the action script for loading and playing a movieclip in a certain area of the stage?

Spot Of Bother Loading External Swf
Oh dear oh dear

I need to load an external swf into a movie clip.
the path is:
_root.mcInfo.mcPanel.mcGallery1

I've tried:
loadMovie("gallery.swf",_root.mcInfo.mcPanel.mcGal lery1);

with no success.The movie loads, into the mcGallery but decides that it wants to be bigger than the mcGallery. Doesn't matter if I make it the same dimensions as the mcGallery.

What am I doing so wrong

Regards

Simon

Loading A Movie Into Flash To A Certain Spot.
I want to load an external .swf file into another flash file, but when I do this and I try to test the file, the external .swf does load when I push a button, but it loades in the top left corner. How do I get the external .swf file to load in the center? or wherever I want it to go?


Thanks in advance.

Loading A Movie In A Specific Spot
is their a simple way to load your movie into a specific spot.. using your x and y coordinates from the:

loadMovienum("home_page_content.swf", 1);

Thank you very much

Loading A Jpg Into A Specific Spot Like An Html Page
Hi i have a photo gallery in wich i load external Jpg into an empty movie clip but i also want to load smaller thumbnails with small jpg into my buttons(externally) but i don't wanna do it with a button action and an empty movie clip , i wanna do it almost like an html page would do it so as soon as i got to where the buttons are located the jpg will load into an hotspot (behind the invisible buttons) , basically i wanna be able to change the thumbnails images externally without going back into the fla.
It is very confusing but i am still a beginner so please be patient with me.
Thanks for your help
Massimo

Loading A Movie Into A Specific Spot On A Static Page
hi. i'm having a bit of a dilemma on this. I want to build this whole site in flash. i want the entire page to be static, except for where the movie will play. see this page, i can draw out what i'm saying better than explain.

http://www.ro-toons.com/brian.html

anyway, i want to load a different movie into that predetermined space, and be able to shuffle forward, and back between the movies. like in doodie.com. i kinda learned that there is a script, or command where you have to target an empty movie clip...but i'm not good at programming, so i really couldn't comprehend. anyway, i'm in flash 4.

if you can help, it would help the cause - for me to put my cartoons up...

thanks much in advance.

MC Easing From Spot To Spot?
Hello everyone,

I have a quite weird problem... I'm trying to make an mc change its x & y coordinations and so move smoothly to a new spot in the scene...

I've been trying to integrate my script in a function but it just doesn't work the mc keeps disappearing by continually going up...

Any ideas how to solve this?

Cheers

What Do U Mean The Same Spot
i tried it, it works, but u have to keep clicking if u want the text keep moving.
There is another script 4 the text keeps moving until u release the mouse. It's on this forum somewhere go find it.

Spot The Bug
Hi any help greatly appreciated:

my code:

for(i=1;i<5;i++){
loadMovie("assets\"+_root["esp1_"+i],this.scrolledMCrecipient.scrolledMC.thumbnails["tn"+i].dropArea);
}

works just dandy but Im concerned as Im getting below error in the output window on testing:

"Error opening URL "file:///C|/working/esp%5Fversion3.1/esp/flas%2Bspfs/assets/undefined"

what the above does is load a several movie clips who grab their external assets (jpegs etc) from a local directory called "assets" onto thumbnail sized clips.

Kind thanks in advance

Would Appreciate A Spot Of Help...
Good afternoon, folks. I've had some pretty casual experience with Flash in the past, but never really got into Actionscript at all. I do know VB script, but the one doesn't exactly transfer over to the other without a few thousand glitches... So, the company I'm working for this summer is modifying a keyboard layout to work with another, similar application. Most things are the same excepting four buttons that do not appear on the new layout. Now, normally this would not be a problem, as I've managed to deactivate the buttons and make them invisible. However, I can't figure out how to turn off the mouse-over popup window displaying the enlarged contents of the buttons (in this case, a big nothing, as I've cleared the glyphs of those particular buttons). Due to how the program is set up, I cannot just delete the buttons without really messing the whole up thing. So, here's the bit where (I think...) the pop-ups are assigned and so on.


code: // glue ButtonClick and ButtonHover to every named button
var i = 1
do {
var button = _root["b"+i];
if (button == undefined) {break;
}// var button should be either plain button or movie
// (as there seems to be no other way to attach glyphs)
if (typeof (button) == "movieclip") {
// these buttons behave like if they were movies, let's fix that
button.onPress = function() { this.gotoAndStop(3); };
button.onReleaseOutside = function() { this.gotoAndStop(1); };
button.onReleaseOutside ()
button.onRelease = function() { this.onReleaseOutside(); _root.ButtonClick(this._name); };
// it should have a glyph - try to select it
if (typeof (button.glyph) == "movieclip") {
button.glyph.gotoAndStop(i)
} } else {
// it's plain button, but it neither has onRelease,
// nor hitTest (which is used for displaying hints)
button.onRelease = function() { _root.ButtonClick(this._name); };
button.hitTest = function(x, y, foo) {
return ((x>this._x)&&(x<this._x+this._width)&&
(y>this._y)&&(y<this._y+this._height))
};
// subscribe button to onMouseMove
Mouse.addListener(button)
}
// finally, do common hint setup (and get to next one)
button.onMouseMove = function() { if (this.hitTest(_xmouse, _ymouse, true)) { _root.ButtonHover(this._name); }
};i++
} while (i>0);



The buttons are named b1, b2, etc. all the way up to b140, I think. The ones I need to disable the popup for are b120, b121, b122, and b123.

Further down the code, I used ._alpha = 0 and .enabled = false to make the buttons invisible and to take care of the "pointer finger" appearing upon rollover.

FYI, this is all in Pro 8. Additionally, my company had outsourced the original keyboard simulation, so the code I'm showing here wasn't written by anybody in-house -- quite frankly, ActionScript is pretty foreign to all of us here.

Any help is greatly appreciated.

Thanks very much.

-Cody

How To Go To Different Spot
hi i am currently working on my website. i am trying to do something like this http://www.tutorialized.com/view/tutorial/Go-To-Different-Spots/30636
but instead of using one large image, i want to use multiple movies clips, so that i dont have to make a new image every time i upgrade or add things. can anyone help me figure out how to do this.

Hot Spot
hello!
im new here. i want to say that this site is really great + good looking
so.. here's my question. i was waondering how could i make hot spots in flash mx? let's say we have map of world. so how would i make every continent a button, so when i'd roll my mouse over it woud change color and that it would contain the url to apropriate site. i hope you understand
thank you!

Spot The Bug
Thank you for your tutorials. I am really new to as, I have managed to make a drawing "thing" which draws different coloured stars. Sometimes it works perfectly and other times it sticks with the one colour. The code is below. Thanks. Also when i download your source files the display is really small. How can i make them full size? im using flash8.
movieclips = ["star","sty","strs"];
i = movieclips.length;
k = Math.floor(Math.random()*i);
var Num:Number = 0;
_root.onMouseDown = function () {
_root.onMouseMove = function () {
var temp = _root.attachMovie(movieclips[k],"star"+ Num++,_root.getNextHighestDepth());
temp._x = _root._xmouse;
temp._y = _root._ymouse;
temp.gotoAndStop(Math.ceil(Math.random()*4));
temp._xscale = temp._yscale = Math.random()*100+20
temp._alpha = Math.random()*100+20
}
}
_root.onMouseUp = function(){
delete _root.onMouseMove;
}

Hot Spot
hello!
im new here. i want to say that this site is really great + good looking
so.. here's my question. i was waondering how could i make hot spots in flash mx? let's say we have map of world. so how would i make every continent a button, so when i'd roll my mouse over it woud change color and that it would contain the url to apropriate site. i hope you understand
thank you!

Hot Spot Queston
Hi,

First of all i am not sure if there is a possibility for this to work, but if it is I would like to know =)
I have a mc that I need to load into a certain place because its location is different between graphics. Maybe I should explain what its for. I am workin on a wheel preview demo, where you have differnt cars and see what different wheels look on them for a breif idea. What I would like to know is if I have the center of the tires where i want the wheels to go, how do i make it so the wheel swf loads into the tire holes(the "Hot Spot") because between teh different vehicles i have different distances apart between the two tires. Any help would be great. Thanks


-Matt

Point At A Spot
Hi,

I would like to make an object that will always point to a sertain spot.

So e.g./i.e.:

If I drag an arrow around a circle, the arrow must always point at the circle.

Is this possible? Like: making a point inside the arrow that will always maintain the closest distance to the circle, so the arrow would rotate and keep pointing at the circle?

Please help me out here, if any suggestions are coming into mind!
[Edited by ZonderZout on 03-05-2002 at 05:47 AM]

Spot Lights
Does anybody know of a good site that teaches how to make spotlights or knows how to do it. I have a book that kind of explains but it really dosent help. Thanks!

Zoom Spot
Hey everyone!

I making a kind of sniper game and I'm trying to make with a oval (like a spot) to zoom in that part. But the hardest part is that the player can drag it. And there are all the time things moving so I can't do it by simply mask it or something.

Has anyone have the brains for the AS of something like this

grtz,

Sapperderflap!

Spot The Errors
Here's a little game where you find the errors and fix them.
I'm hoping to get this fixed soon.
Car:

PHP Code:



onClipEvent (load) {
scrolly=_root.mainGround.ground._width/3;
scrollStart=false;
}
onClipEvent (enterFrame) {
_root.speed = speed;
if (Key.isDown(Key.UP)) {
  if (this._x<scrollx){
  speed += 1;
  } else {
scrollStart=false;
}
}
if (Key.isDown(Key.UP)) {
  if (this._y <75) {
scrollStart=true;
}}
if (Key.isDown(Key.DOWN)) {
speed -= 1;
}
if (Math.abs(speed)>20) {
speed *= .7;
}
if (Key.isDown(Key.LEFT)) {
_rotation -= 14;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 14;
}
  speed *= .75;
x = Math.sin(_rotation*(Math.PI/180))*speed;
y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
if (!_root.boundary.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.6;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door1.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(3);
this._x = 111.1;
this._y = 276.0;
_x += x;
_y += y;
}
x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door2.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 172.7;
this._y = 162.1;
_x += x;
_y += y;
}
  x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.stair1.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(4);
this._x = 251.1;
this._y = 76.0;
_rotation -= 180;
_x += x;
_y += y;
}
  x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.stair2.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(3);
this._x = 251.1;
this._y = 76.0;
_rotation += 180;
_x += x;
_y += y;
}
   x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door3.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 394.1
this._y = 357.0;
_x += x;
_y += y;
}
   x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door4.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(5);
this._x = 183.1;
this._y = 372.0;
_x += x;
_y += y;
}
    x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door5.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 428.1;
this._y = 169.0;
_x += x;
_y += y;
}
   x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.door6.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(6);
this._x = 118.1;
this._y = 239.0;
_x += x;
_y += y;
}
     x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.area2.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(2);
this._x = 428.1;
this._y = 169.0;
_x += x;
_y += y;
}
   x = Math.sin(_rotation*(Math.PI/180));
y = Math.cos(_rotation*(Math.PI/180));
if (_root.area1.hitTest(_x+x, _y+y, false)) {
_root.gotoAndStop(7);
this._x = 118.1;
this._y = 239.0;
_x += x;
_y += y;
}
}
onClipEvent (enterFrame) {
if (this._x> 639) {
this._x = 0;
}
}
onClipEvent (enterFrame) {
if (this._y> 577) {
this._y = 0;
}
}
onClipEvent (enterFrame) {
if (this._x <0) {
this._x = 639;
}
}
onClipEvent (enterFrame) {

}
onClipEvent (keyUp) {
if (Key.getCode() == Key.UP) {
scrollStart=true;
}
}




mainGround:

PHP Code:



onClipEvent (load) {
ground.duplicateMovieClip("ground2", 100);
ground2._y = ground._y+ground._height
groundStarty = this._y;
groundSpeed=10;
}
onClipEvent (enterFrame) {
if (_root.car.scrollStart==false){
this._y+=groundSpeed;
if (this._y<= (groundStarty+ground._height)){
this._y=groundStarty+groundSpeed;
}
}
}

Using Username In Another Spot
Hi all,

Just trying to use visitors usernames again on the next page. Eg. Username: rbetts33 Password: ******** ------>

On next page, Welcome rbetts33

On the login screen I have 2 input text boxes with names:
(instance Name) username_txt - (Var) myName
(instance Name) password_txt - (Var) myPass

1st, does the username text box have to be a dynamic one? Or is input ok?

Secondly, on the next page should I have a dynamic text box calling the username from the first page. What is the code I would use to do this.

Thank you in advance for your help.

Ryan

Using Username In Another Spot
Hi all,

Just trying to use visitors usernames again on the next page. Eg. Username: rbetts33 Password: ******** ------>

On next page, Welcome rbetts33

On the login screen I have 2 input text boxes with names:
(instance Name) username_txt - (Var) myName
(instance Name) password_txt - (Var) myPass

1st, does the username text box have to be a dynamic one? Or is input ok?

Secondly, on the next page should I have a dynamic text box calling the username from the first page. What is the code I would use to do this.

Thank you in advance for your help.

Ryan

XML & XSL, Spot The Error
I've pretty much just started xml & xsl. I'm tryin to write a xsl file that can render an xml file as a tutorial. So far this is my code its incomplete but the bit I have should work but doesnt, completly.
grrr... I can't post it.. I'll make a text file and upload it.

Code here

I Want Hot Spot At The Center
how do i make the hot spot( i mean the " + " sign that appears at the top left corner of a movie clip and its position can be changed by edditing the movieClip)of my movieClip exactly go at the center.if for example my movieClip is an exact circle or squer.
don want to do that maniually for i need it to be prisice!

Help With Spot Light
does any body no how i can make it appear as if colored spot light went over text as if presenting it?

Scroller With Hot Spot
Hello to all,

I have posted a source file that looks like this......




you will see that there is a scroller loaded into the bottom part of the
main movie, you will also see that the scroller scrolls no matter where the mouse is. I would like the scroller to work only when the mouse is over the bottom part of the movie, now I know that this a boolean action but I am not sure of how to write the script, please help, thanks!!

Note: this is a flash 8 file

Can You Spot The Error - I Can't
Hi,

I'm working on a game based on Wheel of Fortune for the students in my math class. Everything looks good to me and works properly until you check your answer. The section of code for this is:

function makeSolveGuess()
{
answer = String(solveGuess.text).toUpperCase();
trace(puzzle);
trace(answer);
if (puzzle == answer)
{
display = puzzle;
displayDef = def;
gameStarted = false;
} else {
trace("not working");
}
} // End of the function

I'm sure I'm just overlooking something. The traces show that puzzle and answer are the same value. I don't know why the conditional is showing they are not equal.

The files are here:
http://www.ActionMath.com/wheel_game1.fla
http://www.ActionMath.com/wheelnumbers.txt

Thanks!

PLEASE HELP Zoom To Spot On Map
what code would I use to hap a map scroll to a certain point of interest?

Below is a link to an fla I made and as you can see you can scroll about the map freely. I want to add a feature that you can locate a certain spot on the map, then the map will basically scroll to that exact point. What code would I put on the button????

Please help been wracking my brain over this one and I am lost.

http://www.yousendit.com/download/WU...TEQ5bEEwTVE9PQ

Spot The Error [XML]
I have this code attached to a mc. I want to attach the info to a movie in the library that has a textfield, for every child nodes but it seems that i'm doing something wrong with the attachMovie... command

fla included.


Code:
onClipEvent (load) {

spacing=20;

xmldata = new XML();
xmldata.ignoreWhite = true;
xmldata.onLoad = function() {
populCat ()
}

function populCat () {
for(i=0; i< xmldata.firstChild.firstChild.childNodes.length; i++){
if(xmldata.firstChild.firstChild.childNodes[i].nodeName == "category"){
cat = attachMovie ("mc_cat", "cat"+i, i);
cat._x = 10;
cat._y = 20;
cat[i].cattext.text= xmldata.firstChild.firstChild.childNodes[i].firstChild;
trace (xmldata.firstChild.firstChild.childNodes[i].firstChild); // will trace correctly
}
}
}
xmldata.load("rss2.0.xml");

}
any ideas?

Spot The Difference
I have an xml based thumbnail gallery which loads the thumbnails into empty movie clips. My first piece of code achieved this without problem.

Old Script

Code:
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.text = raw_text;
}
function GeneratePortfolio(portfolio_xml){
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i < portfolioPictures.length; i++){
var currentPicture = portfolioPictures[i];

var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
currentThumb_mc._x = i * thumb_spacing;
currentThumb_mc._y = i * thumb_spacing;

currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);

currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;

currentThumb_mc.onRollOver = function(){
currentThumb_mc.thumb_container._alpha = 50;
}
currentThumb_mc.onRollOut = function(){
currentThumb_mc.thumb_container._alpha = 100;
}
currentThumb_mc.onRelease = function(){
image_mc.loadPhoto(this.image);
description_lv.load(this.description);
title_lv.load(this.title);
}
}
}

But I did not want the tumbs all in one long row, I wanted a table of columns and rows to display the thumbs.

So then I updated the code so that I could order the thumbnails in a grid structure, the code should load five columns of thumbnails, then start a new row of thumbs.

Now the thumbs do not load at all

What is wrong with my new script?

New Script

Code:
var thumb_spacing:Number = 30;

var thumb_xCo:Number = 0;
var thumb_yCo:Number = 50;

var instanceName:String;

var description_lv = new LoadVars();
description_lv.onData = function(raw_text) {
description_txt.text = raw_text;
}
function GeneratePortfolio(portfolio_xml) {
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i < portfolioPictures.length; i++){
var currentPicture = portfolioPictures[i];
instanceName = "thumbnail_mc" + i;
menu_mc.createEmptyMovieClip(instanceName,i);
menu_mc[instanceName]._x = thumb_xCo;
menu_mc[instanceName]._y = thumb_yCo;
thumb_xCo += thumb_spacing;
if ((menu_mc[instanceName]._x + thumb_spacing) > Stage.width) {
thumb_yCo += 30;
thumb_xCo = 0;
}

menu_mc[instanceName].createEmptyMovieClip("thumb_container",0);
menu_mc[instanceName].thumb_container.loadMovie(currentPicture.attributes.thumb);

menu_mc[instanceName].title = currentPicture.attributes.title;
menu_mc[instanceName].image = currentPicture.attributes.image;
menu_mc[instanceName].description = currentPicture.attributes.description;

menu_mc[instanceName].onRollOver = function() {
this.thumb_container._alpha = 50;
}
menu_mc[instanceName].onRollOut = function() {
this.thumb_container._alpha = 100;
}
menu_mc[instanceName].onRelease = function() {
image_mc.loadPhoto(this.image);
description_lv.load(this.description);
title_lv.load(this.title);
}
}
}
Many thanks

Spot 5 Difference
hi, i did this spot the difference kinda game where user hafta spot 5 difference between 2 pictures...but i need help desperately whereby when user found all 5 differences, a back and replay button appears and also, there'll be an indication that they found all the differences.
currently i oni can spot all differences and that's it....=(

Invisible Hit Spot?
Hi,

Im designing a simple game. A user needs to click a certain spot on the stage. If they get it right they move on, if not an error message appears.
The "hit spot" is a square movie clip with an alpha of zero.

How can I write into code this:

If (user hits where 'hit spot movie clip is){
nextFrame();
else { play error movie clip
}

Thanks!

Draw In Right Spot
Hey,
i have a file set up that whenever a user onpresses with the mouse--it draws. Well..i want when the user draws in a certain area they click the submit button to see if that area is okay and a trace is executed.Here is what i have so far

Spot The Ball
Hi all,

I am trying to create a 'spot the ball' style game and need a bit of help with the coding.
What I'm trying to acheive is to have a stage size of 800 by 600 with an image at the top which is 800 by 400 and when the mouse is moving over the image area, the coordinates are displayed below in dynamic textfields.

I have searched on the forums and found some helpful code to display the coodinates:

ActionScript Code:
myMC.startDrag(true)onEnterFrame=function(){txt1Var=_xmouse+","+_ymouse}btnTarget.onRollOver = function(){myMC.play()}

This code displays the coords but for the whole stage, I need to constrain it to only be visible when the mouse is over the image.

For the next stage I want the user to be able to click the image and for the coords to be dumped to a variable so I can display their selection below and then be passed to PHP later.

If it needs further explanation then please let me know.

Any help would be much appreciated.

T12

Dynamic Hot Spot Name
I have a 3 frame movie clip called "morePix" shaped like a forward arrow. The morePix.onRelease() function loads an external movie using MovieClipLoader(). When the movie loads a back arrow comes up. Eventually I will have about 5 external movies loading into this MovieClipLoader() and I will want the forward and back arrows up until I get to the last movie. I'm trying to figure out how to create a loop to load these movies. I hope that makes sense. It seems easy but I'm stuck. Here's the code I have so far...

morePix.onRollOver = function (){
this.gotoAndStop(2);
}
morePix.onRollOut = function (){
this.gotoAndStop(1);
}
morePix.onPress = function (){
this.gotoAndStop(3);
}
morePix.onRelease = function (){
this.gotoAndStop(1);
my_mc.loadClip("pics2.swf", "container");
}

The sequential movie clips will be pics3, pics4, etc.
thanks,
bfal

Spot The Idiot
maybe its because im tired or maybe its because i've been away for a while, but what have i done wrong? click home and nothing happens

http://www.hoa.littlespanishflea.org...s/index001.swf

Source: http://www.hoa.littlespanishflea.org...s/index001.fla

Can You Spot The Problem?
Hi Guys,

I've created this script to replace the need to use frames which is how I had it working originally. Can anyone see any reason why i can't progress though the if, else if options?

I have the following script on the first frame


Code:
stop();


flipVisible=function(){if (twentyFourBlink.isFlipping) { twentyFourBlink._visible=!twentyFourBlink._visible;}}
flipVisible_si=setInterval(flipVisible,500);


mButton.onRelease = function(){
if (twentyFourBlink.isFlipping == true){
twentryFourBlink.isFlipping = false;
minutes.isFlipping = true;
flipVisible=function(){if (minutes.isFlipping) { minutes._visible=!minutes._visible;}}
flipVisible_si=setInterval(flipVisible,500);

} else if (twelveBlink.isFlipping == true){
twelveBlink.isFlipping = false;
flipVisible=function(){if (minutes.isFlipping) { minutes._visible=!minutes._visible;}}
flipVisible_si=setInterval(flipVisible,500);

} else if (minutes.isFlipping == true){
minutes.isFlipping = false;
flipVisible=function(){if (hour.isFlipping) { hour._visible=!hour._visible;}}
flipVisible_si=setInterval(flipVisible,500);

}else if (hour.isFlipping + twentyFourBlink._visible == true){
hour.isFlipping = false;
flipVisible=function(){if (twentyFourBlink.isFlipping) { twentyFourBlink._visible=!twentyFourBlink._visible;}}
flipVisible_si=setInterval(flipVisible,500);

}else if (hour.isFlipping + twelveBlink._visible == true){
hour.isFlipping = false;
flipVisible=function(){if (twelveBlink.isFlipping) { twelveBlink._visible=!twelveBlink._visible;}}
flipVisible_si=setInterval(flipVisible,500);
}
}


nextButton.onRelease = function(){
if (twentyFourBlink.isFlipping == true){
twentyFourBlink.twentyFour.nextFrame();
twelveBlink.twelve.nextFrame();

} else if (twelveBlink.isFlipping == true){
twentyFourBlink.twentyFour.nextFrame();
twelveBlink.twelve.nextFrame();

} else if (minutes.isFlipping == true){
minute.nextFrame();

} else if (hour.isFlipping == true){
hour.nextFrame();
if(twentyFourBlink._visible == true){
twentyFourBlink._visible = false;
twelveBlink._visible = true;
} else if(twelveBlink._visible == true){
twelveBlink._visible = false;
twentyFourBlink._visible = true;
}
}
}
and I have these on the movie clips at the moment

Code:
twentyFourBlink has this:
onClipEvent(load) {
this.isFlipping = true;
}

twentyBlink has this:
onClipEvent(load) {
this._visible = false;
}

minutes hasthis:
onClipEvent(load) {
this.isFlipping = true;
}

hour has this:
onClipEvent(load) {
this.isFlipping = true;
}
Hope that makes sense. It would be great if someone can spot the problem.
thanks

Spot Light
Im trying to create a spot light affect over the whole intro

I want to move 2 spot lights from left to right accross the screen.

Any ideas?

Thanks

Nick

Spot The Difference
hi, i did this spot the difference kinda game where user hafta spot 5 difference between 2 pictures...but i need help desperately whereby when user found all 5 differences, a back and replay button appears and also, there'll be an indication that they found all the differences.
currently i oni can spot all differences and that's it....=(

Show Mc At A Sertain Spot
i have 3 button at the main stage.For ex named a, b and c
if i press button a, a mc named 1 move to a spot and show a news clip. and if i press button b, the mc named 1 move to another spot and shows another clip. And i have set a button on the "news mc" that set it to visble=0 but when i press button a it doesent show up again.. sounds ****ed up? here is the fla
http://marshal.linc-up.com/ex/hmm.zip
please help me..

Dynamic Spot Drawing
I want to know if it´s possible to make this:

1) How can I draw a point if I know the distance and the degrees from a star point? in other words I have the polar coordinate and not the rectangular coordinates and I wanna to draw a point in that location, how can I do that?.

I want to know this because, I have to arrays one with the distance from a start point and other with the phase (degrees) of each point of the first array, and I wanna to draw a point in each coordinate and the result will be like if I was dynamicly drawing a picture.

Running Mutiple MC's In 1 Spot.
Ok well I made a website and want all my MC's(which would be different sections on the site IE: home, pics ect...)to run in the same spot . When a button is pressed i want the MC to apear atop the previous MC, how would i go about doing this ? would i adjust depth ? and if so how ??? i'm new to the more hardcore action scripting .

+-- Resize Window On The Spot ---+
Hey... anybody seen DevLab's resizing window on the spot functionality? Instead of bringing up a new window with a different size, they have it so the windows resize in front of you. This is Swift 3d devlab.

Does anybody know how to do this?

Thanx.
Nasi

Zoom In/out, Center On Spot
i am trying to do this file that allows users to zoom in and out, and "pull" the movie clip around.. much like a location map.

the problem is.. when the user "pulls" the desired location into the viewing area.. how do i center the location after he zooms in or out?

many thanks in advance!

Copyright © 2005-08 www.BigResource.com, All rights reserved