Giving Movieclips Their Own Code
I'm making a small game. The way I have it now, is that I put an original of each movie clip that I'll need somewhere to the side so I can duplicate it whenever i want to. These movie clips have their own code to tell them what to do.
The way I would like to make it is that I link all of the movie clips to the stage from the library instead of having them all on stage to start with. So is there a way that I can call duplicateMovieClip to duplicate a movie IN my library, but also have all of the code that I want it to have?
FlashKit > Flash Help > Flash MX
Posted on: 12-08-2002, 12:49 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Giving Attached Movieclips Actions?
I have a button that is dynamically attached using attachMovie. I then want to give it an onRelease action but am having trouble. This is the script i am using:
Code:
empty.onLoad = function(){
attachMovie("mybutton_btn", "mybutton1", _root)
mybutton1._x=277.75
mybutton1._y=216.45
}
mybutton1.onRelease = function(){
songlist.splice(0, songlist.length)
songlist.push("one.mp3")
songlist.push("two.mp3")
songlist.push("three.mp3")
_global.nosongs = songlist.length;
songs=songlist
#include "jimmytracks.as"
}
the first part of it (the attaching and repositioning of the button) work perfectly, but for some reason the onRelease function wont work. Can anyone help me out here? It would be much appreticated.
Giving OnPress Function To Dynamically Created Movieclips?
Ok, here's the setup. I'm using php & mysql to get a list of pictures from the mysql database, the php outputs the location of the pictures in an xml formatted page, and then flash gets the list of pictures, and dynamically creates movieclips inside of a scrollpane.
That being said, i need to add functions to all of these dynamically created movieclips inside of the scrollpane, and I've been having trouble getting it to work. Here's the code. It resides on the first frame of panehomeclip, and then panehomeclip is loaded into a scroll pane. Then i refreshed it a whole bunch with a setinterval command on the main timeline.
//-------------------------[as]--------------------------------------------
this.myX = 50;
this.myY = 230;
this.MovingCount = 2;
this.pArray = new Array();
this.count = 0;
//GALLERY CODE START
// The first step is to activate the XML object
headlineXML = new XML();
/*
With the XML Object now active you must now load an XML foramtted document.
Any DTD or XLS formatting will be ignored.
*/
headlineXML.onLoad = myLoad;
headlineXML.load("http://www.changedtoprotecttheinnocent.com/clubsports/gallery/getpics.php");
// Before proceeding to far into the program, make sure the XML document has loaded
// Extract information from the XML file
function myLoad(ok) {
if (ok == true) {
Publish(this.firstChild);
}
}
function doOnLoad(mc) {
mc._xscale = 20;
mc._yscale = 20;
}
function Publish(HeadlineXMLNode) {
if (HeadlineXMLNode.nodeName.toUpperCase() == "PHOTOGALLERY") {
story = HeadlineXMLNode.firstChild;
while (story != null) {
if (story.nodeName.toUpperCase() == "PHOTO") {
myphoto = story.firstChild.nodeValue;
this.pArray[this.count] = myphoto;
var mc = createEmptyMovieClip("picmc"+this.count, this.count);
var temp = eval("picmc"+this.count);
mc.loadMovie("http://clubs.kennesaw.edu/clubsports/clubsites/"+myphoto);
temp.onPress = function() {
trace("hit");
}
mc.onLoad = doOnLoad(mc);
if (this.MovingCount == 3)
{
this.myY = this.myY + 90;
this.myX = 50;
this.MovingCount = 0;
}
mc._x = this.myX;
mc._y = this.myY;
this.count = this.count+1;
this.MovingCount = this.MovingCount + 1;
this.myX = this.myX + 130;
element = element.nextSibling;
}
story = story.nextSibling;
}
}
}
----------------------------------[as]---------------------------------
I've tried to use var mc like so. . .
mc.onPress = function {
trace("hit");
}
It's kinda of technical, and I'm not sure if it's possible, seems like I would be generating code that isn't there, or maybe I can duplicate a movie clip from the library, I don't know, any suggestions would be awesome.
Tab Order Code Giving Me One Error
Hiya flashers, I am using a tab order actionscript to control the tabs in my form. I keep getting this error
Symbol=data 2, Layer=Layer 1, Frame=1: Line 6: Unexpected '}' encountered
} else if (Selection.getFocus() == "_level0.groupID")
Whats wrong with my tab actionscript?
on (keypress "<Tab>") {
if (Selection.getFocus() == "_level0.fname") {
Selection.setFocus("_level0.lname");
} else if (Selection.getFocus() == "_level0.lname")
Selection.setFocus("_level0.groupID"); }
} else if (Selection.getFocus() == "_level0.groupID")
Selection.setFocus("_level0.chole"); {
} else if (Selection.getFocus() = "_level0.chole")
Selection.setFocus("_level0.cscore"); {
} else if (Selection.getFocus() = "_level0.cscore")
Selection.setFocus("_level0.ttime"); {
} else if (Selection.getFocus() = "_level0.ttime")
Selection.setFocus("_level0.town"); {
} else if (Selection.getFocus() = "_level0.town")
Selection.setFocus("_level0.shole"); {
} else if (Selection.getFocus() = "_level0.shole")
Selection.setFocus("_level0.sscore"); {
} else if (Selection.getFocus() = "_level0.sscore")
Selection.setFocus("_level0.scr1"); {
} else if (Selection.getFocus() = "_level0.scr1")
Selection.setFocus("_level0.scr2"); {
} else if (Selection.getFocus() = "_level0.scr2")
Selection.setFocus("_level0.scr3"); {
} else if (Selection.getFocus() = "_level0.scr3")
Selection.setFocus("_level0.scr4"); {
} else if (Selection.getFocus() = "_level0.scr4")
Selection.setFocus("_level0.scr5"); {
} else if (Selection.getFocus() = "_level0.scr5")
Selection.setFocus("_level0.scr6"); {
} else if (Selection.getFocus() = "_level0.scr6")
Selection.setFocus("_level0.scr7"); {
} else if (Selection.getFocus() = "_level0.scr7")
Selection.setFocus("_level0.scr8"); {
} else if (Selection.getFocus() = "_level0.scr8")
Selection.setFocus("_level0.scr9"); {
} else if (Selection.getFocus() = "_level0.scr9")
Selection.setFocus("_level0.tout"); {
} else if (Selection.getFocus() = "_level0.tout")
Selection.setFocus("_level0.scr10"); {
} else if (Selection.getFocus() = "_level0.scr10")
Selection.setFocus("_level0.scr11"); {
} else if (Selection.getFocus() = "_level0.scr11")
Selection.setFocus("_level0.scr12"); {
} else if (Selection.getFocus() = "_level0.scr12")
Selection.setFocus("_level0.scr13"); {
} else if (Selection.getFocus() = "_level0.scr13")
Selection.setFocus("_level0.scr14"); {
} else if (Selection.getFocus() = "_level0.scr14")
Selection.setFocus("_level0.scr15"); {
} else if (Selection.getFocus() = "_level0.scr15")
Selection.setFocus("_level0.scr16"); {
} else if (Selection.getFocus() = "_level0.scr16")
Selection.setFocus("_level0.scr17"); {
} else if (Selection.getFocus() = "_level0.scr17")
Selection.setFocus("_level0.scr18"); {
} else if (Selection.getFocus() = "_level0.scr18")
Selection.setFocus("_level0.tin"); {
} else if (Selection.getFocus() = "_level0.tin")
Selection.setFocus("_level0.ttl"); {
} else if (Selection.getFocus() = "_level0.ttl")
Selection.setFocus("_level0.egs"); {
} else if (Selection.getFocus() = "_level0.egs")
Selection.setFocus("_level0.brds"); {
} else if (Selection.getFocus() = "_level0.bds")
Selection.setFocus("_level0.prs"); {
} else if (Selection.getFocus() = "_level0.prs")
Selection.setFocus("_level0.bgs"); {
} else if (Selection.getFocus() = "_level0.bgs")
Selection.setFocus("_level0.dbgs"); {
} else if (Selection.getFocus() = "_level0.dbgs")
Selection.setFocus("_level0.acs"); {
} else if (Selection.getFocus() = "_level0.acs")
Selection.setFocus("_level0.otr");
}
Searcher
Help With Code On Movieclips
Hello - I am using MX and need to change the code on the attached swf to fit my menu system. Right now, the menu system is set up so that I have 3 mc's and the "pressed" mc changes places with the mc that is on the top.
What I need is for the "pressed" mc to go to the top of the order and the mc that was on top go to the last position and the 3rd mc moves up to 2nd position.
I just want the mc that gets "pressed" moves to the top and all other mc's move up to the next position. Does this make sense?
I have attached the file and would appreciate any help.
MovieClips And External Code
I have a movieClip in my library called mcButton with code attached like so:
this.onRelease = function():Void
{
trace("Released: "+ this);
this.button_txt.setTextFormat(mouseActive_fmt);
}
Now I want to use several instances of these buttons on my stage. But I can;t get the clip to react to any event from an external #include file with code like onRelease - only the code that is on the symbol works. I did it this way so I wouldn't have to write the same behavoirs for every button I placed on the stage. Here is my Include code:
btnContactUs_mc.onRelease = function():Void
{
trace("timeline release code has run")
_root.attachMovie("mcContactUs","contactUs_mc",10); //sub navbar
}
I get nothing from this at all. Does the movieClip code take precedence? If I put everything in the #include file it works fine. (of couse I change "this" to "btnContactus" when I move it).
I know I could have extented the movieclip class instead but I chose to do it this way. It should work, right?
Edited: 11/18/2006 at 11:32:39 PM by noviceone
Attaching Code To Movieclips In Library
Im making a game and i want to load in with actionscript movieclips in the library. However, i want these movieclips to contain code that will load with them onto the stage, and from what ive heard attachMovieclip doesnt do this. I dont want to have a clip existing on the stage in the begining and then use duplicateMovieclip. Anyone know if this can be done or how to do it?
Making Code Work In External Movieclips.
I have a flashsite that uses a "containerMovie.swf" that is the main movie and all my site loads into this: headers, buttons etc.
Now I've created buttons using dynamic text fields and so on in one of the external .swf's that load into this main movie (sample1.swf, sample2.swf, sample3.swf...etc.) when you click on the corresponding button.
So what I want to do is take the code and put it in the main (containerMovie.swf) so that if the client wants to change the font, text, size whatever) I can simply make the change to the containerMovie.swf and it will universally change the atrributes of these buttons.
I hope this isn't too confusing, any help greatly appreciated, Matt
HERE's THE CODE:
stop();
//------------- color change
var overColor:Number = 0xEE0000;
var outColor:Number = 0x000000;
function changeOptionColor (myOption:MovieClip, myColor:Number) {
myOption.label.textColor = myColor;
};
//-------------/color change
//--------------------<EMPRESS button AS>---------------------\
this.empress.label.autoSize = "center";
this.empress.label.text = "• Empress/EmpessII/Empress Esthetic";
// onRollOver
this.empress.onRollOver = function() {
empress.gotoAndStop (2);
changeOptionColor(this, overColor);
}
// onRollOut
this.empress.onRollOut = function() {
empress.gotoAndStop (1);
changeOptionColor(this, outColor);
}
// onRelease
this.empress.onRelease = function() {
getURL("http://www.ivoclarvivadent.us.com/us/en/products/empress/empress_kombiprod.html","_blank");
}
//--------------------</EMPRESS button AS>---------------------\
Problem With Writing Code On Nested MovieClips
Hi Dudes,
I have a nested MovieClip. I'm facing some problem when writing the code for both the inner and outer MovieClips.
I'm writing onRollOver state for inner and outer MopvieClips. The event is triggered for the root MovieClip(outer one) but not for the inner MovieClip.
I want to trigger the event for both the parent(root MC or outer MC) and child(inner or child) MovieClips.
Can any help me reagrding this?
Thanks in advance.
Regards,
kums
Proper Code For Dynamically Placing A Grid Of Movieclips
i have a variable number of movieclips that i want to place on the stage in a grid 5 items wide(ie if there are 7 items there would be two row, 11 three rows, etc.). for intervals of 5 the clips will be spaced by 45pix then the x positision should return to 0 and the y increase by 45pix for the next five, etc. i know there is a clean way to do this but i can't figure it out..
for (var i =1; i <=(_root["direct"+u+"array"].length); i++){
btn = _root.mainload.director_template.director_clips.at tachMovie("director_clips_button", "directclip"+i, i);
//trying to figue out these intervals.
//btn._x=((i*45)-45);
//btn._y=???;
}
[MX04] Limiting The Number Of Duped Movieclips And Rotation Code...
hi, i want to know wether there is a way to duplicate a movieclip with a linkage name of 'fireball', and set it's rotation to the player once... so that if the player moves, the fireball will miss him...
i also want to know wether there is a way to limit the speed at wich these fireballs can be duplicated, eg. the player presses the space bar and it shoots only one fireball, even if the space bar is held down, untill he releases it and presses it again to shoot another fireball...
at the moment i am using this:
Code:
if(Key.isDown(Key.SPACE)) {
blah blah blah... duplicate fireball, tried to set rotation but it didn't work...
}
however this code makes it so that if the user even just taps the space bar, it will shoot loads of fireballs at once because of my high framerate, but i need the framerate to be high, so i can't change that... and even if i did, it wouldn't help the fact that lots of fireballs are still launched when you hold down the key
any help is greatly appreciated... thanks
Using The Photo Gallery Thumbnail Scroll Code For Independent Movieclips
I'm using the xml gallery vertical scrolling thumbnails code for my portfolio site. But, I have another section in the site that is separate from the gallery section where I want a movieclip to scroll the same way the thumbnails are scrolling (speed, same hit test, etc.) but I'm not sure how to alter the code to simply make a movie clip move the same way. I tried just changing the movieclip name, but it didn't work. Am I over-thinking it?
This is the code that is being used for the gallery.
Code:
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._width)) {
if ((_root._ymouse>=(hit_right._y-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._y -= scroll_speed;
} else if ((_root._ymouse<=(hit_left._y+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._y += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
I'm Giving Up
Hey guys,
I've spent the last week now trying to do this right but its not working. Its the last part I need help with, so if anyone wants to help me one more time with basically the same problem I'd really appreciate it. Here's the tutorial I was using guys
http://www.flashkit.com/movies/Scrip...-257/index.php
and here is the FLA file that I'm working on.
www.project-09.com/help.fla
Once again I just need the scroll buttons to stop the text when it reaches the very top and button. I keep changing the _y values but it doesn't work. Here's how ArmedJimmy set up the ascript for me. This script was for a diff. scroll box.
on (release) {
if(scroll.Text._y <= 0.5){
setProperty("Scroll/Text", _y, getProperty("Scroll/Text", _y)+10);
}
}
Giving AS To All
Hey, How'd you make it so that you can give action script to everything, which has "enemy" in the instance name, (Such as enemy1, enemy2, enemy3 ect.)
So you would put action in the main frames, that would give the actions to enemy1, enemy2, enemy3, and so on.
(Btw, Say that the action was:
if (this.hitTest(_root.bulleter)) {
enemyspeed = 0;
enemystepsright = 0;
enemystepsleft = 0;
dead = true;
this.gotoAndStop("dead");
}
Thanks
Giving A Variable In An Other MC A Value
I've got an MC's created dynamicaly.
Say...
MovieClip1
MovieClip2
MovieClip3
In each movieclip there is a button.
What I need, is to know wich button is pushed.
I've used the code
Code:
name=this._name
number=Number(substring(name,10));
To get the number value, but the real problem is that I need that value in an other movieclip!
And I cannot reach the variable 'number' cause I don't know the path, for I don't know wich button is pushed, wich I want to know!!!!.
I tried to following code, but that didn't work
Code:
name=this._name
_root.otherMC.number=Number(substring(name,10));
Were I declared number in otherMC, but that didn't work.
How can I use the variable 'number' ?
BytesTotal Always Giving Me 0
var holder = this.createEmptyMovieClip("holder", 1);
holder.loadMovie("aboutUsImage08.jpg");
btotal = holder.getBytesTotal();
bloaded = holder.getBytesLoaded();
trace(holder.getBytesTotal());
Giving Many Mc's Same Functions
hi instead of adding functions to each sperate MC like this:
code:
onClipEvent (load) {
var speed = 0;
}
onClipEvent (enterFrame) {
_alpha -= speed;
}
could i do sumthign like this?:
code:
square = [square0,square1,square2,square3,square4,square5]
for (i=0; i<square.length;++i){
square[i].onLoad = function(){
speed = 0;
}
square[i].onEnterFrame = function(){
_alpha -= speed;
}
}
or this
code:
square = [square0,square1,square2,square3,square4,square5]
i=0
if (i<square.length){
i=i+1
}
square[i].onLoad = function(){
speed = 0;
}
square[i].onEnterFrame = function(){
_alpha -= speed;
}
can u piont me in the wrtie direction?
thanx in advance
Giving Up On ActionScript... Pls Help.
Hello everyone..
I did tried, but things are getting a little weird right now.
I created an imaginary madrix 7x7 where this matrix starts from the center, square 25.
The idea is to move the frame around and show in which xy is located, lets say, square 34 if the user moves x times to the right and y times down.
The problem is that at the beginning it DOES work, but when i do start moving around, it kind of swaps the values of the imaginary matrix.
Quite hard to explain, pls download the code and try urself.
How can i solve this mistery?
Any clues, suggestions, hints?
Here is part of the code:
Code:
function right()
{
mc_all_areas._x = mc_all_areas._x -10;
_global.m_click_x--;
m_v_x=mc_all_areas._x / 240 ;
if(_global.m_click_x % 24 == 0)
{
trace("POSITION: "+ ((25- m_v_x)- (7 * m_v_y)));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._x/240)*1)))));
trace("dist x from center: "+_global.m_sq_x_dist_center);
}
}
function left()
{
mc_all_areas._x = mc_all_areas._x +10;
_global.m_click_x++;
m_v_x=mc_all_areas._x / 240 ;
if(_global.m_click_x % 24 == 0)
{
trace("POSITION: "+ ((25- m_v_x)- (7 * m_v_y)));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._x/240)*1)))));
trace("dist x from center: "+_global.m_sq_x_dist_center);
}
}
function up()
{
mc_all_areas._y = mc_all_areas._y +10;
_global.m_click_y++;
m_v_y=mc_all_areas._y / 320 ;
if(_global.m_click_y % 32 == 0)
{
trace("POSITION: "+ ((25+m_v_x- (7*m_v_y))));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._y/320)*1)))));
trace("dist y from center: "+_global.m_sq_y_dist_center);
}
}
function down()
{
mc_all_areas._y = mc_all_areas._y -10;
_global.m_click_y--;
m_v_y=mc_all_areas._y / 320 ;
if(_global.m_click_y % 32 == 0)
{
trace("POSITION: "+ ((25-m_v_x- (7*m_v_y))));
_global.m_sq_y_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._y/320)*1)))));
trace("dist y from center: "+_global.m_sq_y_dist_center);
}
}
[CS4] Giving Buttons An ID
Hi,
I am new to flash and i am trying to assign an ID to a button to pass to a php script. Of course i could hardcode the url so that on click of each button it passes its id, however, this would involve repetition. Instead i want to specify
an id to each button that i can reference in a generic actions script as a parameter to my php. e.g
each button has an id variable $id = 1 then in the action script i can say on click getURL ( "example.php?id = $id");. A simple solution to you gurus i am sure.
I have searched hi and low for a simple solution to this. As a coder by profession i know there must be a simple way to achieve this, can someone point me in the right directions?
Many thanks,
Jim
Giving An Order To A Mc
Hello i have a question...lets say i have mc_1 on my main time line. And inside this mc there are certain animations. At a point if something happens on the main stage mc_1 plays the animation on frame 5. Now how can i tell my mc_1 to go to and play something else on the main timeline when it is on frame 10?
Should i use the clipevent? How can i achive this....thank you so much for your time..!
AFP Giving Me Fits
Every time I go to a site that uses AFP it says that I do not have the latest version and directs me to the Adobe site. I go there and dutifully upgrade that which I have "upgraded" many times before and it still does not work.
The only thing that has been successful is to simply uninstall the Flash Player and then use RegScrub to eliminate all vestiges of it from the registry and then reinstall and reboot until the next time it fails.
What is happening that makes the program not work even though I already have the latest version and why don't the "upgrades" work causing, me to have to jump through hoops?
The same thing happens at Youtube.com, military.com, etc.
Other media viewers I have installed are WMP, VLC Media Player, AvRack, QuickTime, Google Video Player. I also have recording software CamStudio, and Audacity. I use WMP and VLC regularly and seldom use the rest. I nearly never use the recording software.
Any suggestions?
Giving A Box A Shadow...
Like this one has: http://www.chillskatemag.com/
It's probably the most simplest thing in the world, and yet I can't figure it out and can't find any sort of tutorial related to it.
Something tells me I have to draw with the paintbrush, but when I do the brush isn't soft enough.
Anyone care to help a lil stupid n00b?
Giving Up On ActionScript... Pls Help.
Hello everyone..
I did tried, but things are getting a little weird right now.
I created an imaginary madrix 7x7 where this matrix starts from the center, square 25.
The idea is to move the frame around and show in which xy is located, lets say, square 34 if the user moves x times to the right and y times down.
The problem is that at the beginning it DOES work, but when i do start moving around, it kind of swaps the values of the imaginary matrix.
Quite hard to explain, pls download the code and try urself.
How can i solve this mistery?
Any clues, suggestions, hints?
Here is part of the code:
Code:
function right()
{
mc_all_areas._x = mc_all_areas._x -10;
_global.m_click_x--;
m_v_x=mc_all_areas._x / 240 ;
if(_global.m_click_x % 24 == 0)
{
trace("POSITION: "+ ((25- m_v_x)- (7 * m_v_y)));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._x/240)*1)))));
trace("dist x from center: "+_global.m_sq_x_dist_center);
}
}
function left()
{
mc_all_areas._x = mc_all_areas._x +10;
_global.m_click_x++;
m_v_x=mc_all_areas._x / 240 ;
if(_global.m_click_x % 24 == 0)
{
trace("POSITION: "+ ((25- m_v_x)- (7 * m_v_y)));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._x/240)*1)))));
trace("dist x from center: "+_global.m_sq_x_dist_center);
}
}
function up()
{
mc_all_areas._y = mc_all_areas._y +10;
_global.m_click_y++;
m_v_y=mc_all_areas._y / 320 ;
if(_global.m_click_y % 32 == 0)
{
trace("POSITION: "+ ((25+m_v_x- (7*m_v_y))));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._y/320)*1)))));
trace("dist y from center: "+_global.m_sq_y_dist_center);
}
}
function down()
{
mc_all_areas._y = mc_all_areas._y -10;
_global.m_click_y--;
m_v_y=mc_all_areas._y / 320 ;
if(_global.m_click_y % 32 == 0)
{
trace("POSITION: "+ ((25-m_v_x- (7*m_v_y))));
_global.m_sq_y_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._y/320)*1)))));
trace("dist y from center: "+_global.m_sq_y_dist_center);
}
}
Giving A Box A Shadow...
Like this one has: http://www.chillskatemag.com/
It's probably the most simplest thing in the world, and yet I can't figure it out and can't find any sort of tutorial related to it.
Something tells me I have to draw with the paintbrush, but when I do the brush isn't soft enough.
Anyone care to help a lil stupid n00b?
Giving An Id To MC In Loops
i have a strip of thumbnail pictures that is created with attachMovie like this:
Code:
function BuildStrip() {
for (i=0; i<=35; i++) {
this.targetClip.attachMovie("frame", "frame"+i, i);
targetClip["frame"+i]._x = 103*i;
targetClip["frame"+i].loadMovie("thumbnails/an"+i, ".jpg");
}
}
BuildStrip();
each picture needs to open a diffrent enlargment in html. so i need to id each mc and attach a diffrent code.
and i hink i need help with that......
Giving Player With CD
I am creating a Corporate CD. But my problem is giving the player with. I published it as an exe to. Will that solve my problem? And if someone maybe knows how to supply acrobat to.
Giving Parameter To Swf
Hi,
I have a question.
Is it possible to give a parameter, say a message, "completed" then making the flash character to "speak" the message? if so, how wuold one do this?
Any help would be muchly appreciated. Thanks in advance!
>> Please Help - Preloader Is Giving Me Hell
I am trying to build a preloader using this tutorial and it isn't working too great.
As of now, I have this in the second frame('done' is the 4th frame):
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
gotoAndPlay ("done");
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop (_root.frame);
}
and this in the third frame('start' is the first frame):
gotoAndPlay ("start");
For some reason, when I test the movie, it starts off at the 32nd frame of the main scene. It doesn't even show the preloader scene. >
If you want you can check out what the preload scene/main scene look like(an older version) here.
Thanks for any help you can give. Just throw out any ideas.
- Matt
Giving Rollovers The Finger, Or Not, Actually
Heyas.
Im trying to have images in my movie that have text associated with them when you roll over them. It's not dynamic or anything. The problem is that I dont want that stupid little finger to show up, since that would make people think that they've stumbled onto a button- and clicking on something with not functionality can really frustrate a user. I tried making my images a movie clip with 2 frames and giving it a mouseover event, but mouseover events only work with buttons. Buttons always give me the little hand cursor. And the images will be moving around and resizing, so I cant set coordinates for the rollover to work on.
Is there a way to do what Im proposing? To have a rollover without changing the cursor? Thanks for any help.
Giving Away An I-Mac And $1000 Cash
For some reason I wasn't able to post this in the COMPETITION Forum, but I can here.
For beginners and Pro's, I've found a site that's got a monthly competition for designing static and Flash Icons for use in electronic slot machines. I haven't won yet, but here's the URL and details from the site if anyone wants to check it out:
http://www.spam.com/
Competition Details
Bigfoot Gaming is pleased to offer a monthly or bimonthly competition to artists, to turn their creativity and talent into cash and prizes.
Do you think you can design better icons and game themes than what you see in your local casino?
Enter now and attempt to become one of our Regular Winners.
Create a set of image symbols, which are based on a similar theme, or the suggested theme of the month.
This Month's Theme: Love Potion
Prizes awarded based on creativity, detail, and quality of the entry.
Category 1 range up to an Apple Mac and / or $ 1,000 cash.
Category 2 up to $ 500 cash
--------------------------------------------------------------------------------
Contents
1. Summary
2. Purpose of the Competition
3. Entry Category 1
4. Entry Category 2
5. Files Specifications
6. Making an Entry
7. Acceptable Tools
8. Judging and Prizes
--------------------------------------------------------------------------------
1. Summary
Create a set of image symbols which are based on a similar theme, or the suggested theme of the month.
Entries are not restricted to the monthly theme, but it is used only as a reference point for those who can't think of a theme.
The difference between a Category 1 and Category 2 entry is the quality and tools used.
Any program may be used to create the symbols images.
The symbol images must be 300 pixels wide by 250 pixels in height.
Image resolution must be 150 dots per inch, however higher resolution is encouraged.
Include a text file explaining how you made you images, and how long it took to make.
Back to the Top
2. Purpose of the Competition
1. The intentions of the competition and what we hope to gain from it.
The competition is open to all applicants that satisfy the terms and conditions. We seek and encourage, and will promote Artist from all works of life to think creatively to create Themes, name and matching symbols.
You do not have to be a professional, or educated in this field! Experts are welcome, as much as amateurs with cheap tools. We are impressed by creativity and talent.
Bigfoot Gaming reserves the right to reject and remove any submission, at any time, for any reason.
Judge for yourself what category you should be in.
(Minimum entry for Category 1 is PSD or AI files)
Back to the Top
3. Entry Category 1
An entry for Category 1 must consist of the following :
A game theme name
7 game themed symbols, 2 static, and 5 animated. (See static files and animated files)
Max 360 second animation of themed bonus game. (See animation files)
Themed splash screen for game. (See splash screen files)
A text file describing any game rules, which tools were used to make the images where made, and the time it took to create.
Back to the Top
4. Entry Category 2
An entry for Category 2 must consist of the following :
A game theme name
7 game themed symbols. (See static files)
Themed splash screen for game. (See splash screen files)
A text file describing any game rules, which tools were used to make the images where made, the and the time it took to create.
Back to the Top
5. Files Specifications (General)
File size (per symbol or animation or splash screen) are not to exceed 5MB. We do not have a bottomless hard disk (unfortunately!).
5a) Text Files
A text file must be included with an entry. It must include the game theme name, any game rules which trigger the animation, which tools were used to make the entry, and the estimated time it took to create the entry.
5b) Static Symbol Files
Category 1
Static (non-animated) themed symbol image files must be :
300 pixels in width and 250 pixels in height,
24-bit true colour
Multi-layered Adobe Photoshop 5 (or later) .PSD format, or, Adobe Illustrator 9 (or later) .ai format.
Layers must include a separate background layer, if a background is a part of the symbol.
Category 2
Static themed symbol image files must be :
300 pixels in width and 250 pixels in height,
24-bit true colour
JPG, TIF, GIF, or MS-Windows BMP format.
(Animated GIF may be included with Category 2 entries).
5c) Animated Symbol Files
The animated symbol frame sequence may be up to 16 frames in length, but at least 4.
The animated symbol sequence may contain up to 12 different frames.
Animation files may be up to 360 seconds long. Animation submissions must be of 3D Studio Max (.max), Macromedia Director (.dir), After Effects or AVI file format.
Each frame of the animated themed symbol image files must be:
300 pixel in width and 250 pixels in height,
24-bit true colour
Multi-layered Adobe Photoshop 5 (or later) .PSD format, or, Adobe Illustrator 9 (or later) .ai format.
Layers must include a seperate background layer, if a background is a part of the symbol.
5d) Themed Splash Screen
Category 1 - 1,200 pixel in width and 800 pixels in height.
24-bit true colour,
Multi-layered Adobe Photoshop 5 (or later) .PSD format, or, Adobe Illustrator 9 (or later) .ai format.
Layers must include a seperate background layer, if a background is a part of the splash screen.
Category 2 - 1,200 pixel in width and 800 pixels in height.
24-bit true color, JPG, TIF, GIF, or MS-Windows BMP format.
Back to the Top
6. Making an Entry
Entrants must agree to the terms and conditions before entering the competition.
Entries must follow the above guidelines in order to be eligible for prizes.
An account must be created before an entrant can make a submission.
Your uniquely generated account password will be sent to your email address.
Files should be zipped before submitting via the Submit Entry page
6a) Web Entries
Files up to 5 Megabytes can be uploaded (one at a time), after logging into the submission area.
Once receiving your password, (refer making an entry) you can log in and upload your file entry.
6b) Mail Entries
Entries will also be accepted via mail. The mail address is available once you have registered.
Mail submissions must be on CD in PC or MAC format.
Back to the Top
7. Acceptable Tools
Any tools hardware, software may be used in the production of the images, however the final submissions must conform to the Symbol file definitions.
Back to the Top
8. Judging and Prizes
Prizes awarded based on creativity, detail, and quality of the entry.
Category 1 range up to an Apple Mac and / or $ 1,000 cash.
Category 2 up to $ 500 cash
All decisions of bigfootgaming.com. are final and no correspondence will be entered into.
Late submissions will automatically be entered into the next competition round.
The winning entrant will be notified by email or via the web site and prizes will be mailed out within 24 hours of successful entries being chosen.
You may not use copyrighted works as a part of your entry.
Back to the Top
[Edited by david petley on 12-30-2001 at 03:38 PM]
Not Giving A Random Alpha
Im duplicating some clips on stage but there isnt a random alpha which i wanted..
Is this line of code wrong..
_root["ringInstance"+i]._alpha = random (30);
Giving Buttons Actions..
is it possible to give a button more than one action after it's pressed?? So after pressing the button, it loads a movie clip and then plays another one after it's done.
Giving A Dynamic Button A Value ?
Is it possible to add a value to a button.
At the moment i have written an array of buttons dynamically to the screen
like this
Paul - Button Here
David - Button Here
Karl - Button Here
Rich - Button Here
When a button is pressed it will go to another frame and show an individuals results. So i need to give the button the individual ID.
note: there is a button inside the mc called 'Detials'
this is how i have created me buttons
for (i=0; i<OrgNameArray.length; i++) {
this.attachMovie("yourBut", "c"+i, i);
var q = this["c"+i];
q._x = 605.9;
q._y = 125 +(q._height*i);
q.textf.text = OrgNameArray[i];
}
Giving Each Duplicated Movie His Very Own ID
I would like to know if (and how) I could give each duplicated movie a unique ID (a number).
I tried it, but it worked not very well... The ID must be a variable. This variable must give me the possibility to load the corresponding external MovieClip.
someone who know a solution?
thanks
dries
Loader, Giving Problems
Hey I have a little movie problem.
its a picture as background and some text that fades in and moves from right to left and then a stop. very easy..
but when i add my loader only the picture shows not the text effects..
the loader works ok but i can't figure out why it doesn't play all of the frames.. any help ?
no mc's no code nothing just a stop.
thanks.
Keeping Score Giving Me A NaN
Hello, I am attempting to reuse code that once worked for me in Flash 5.
In the process of making a quiz I have multiple choice answers each with a button. The right answer has this code.
on (release) {
_root.score = _root.score+10;
gotoAndPlay(X);}
X being the next slide. Repeat process for 10 slides.
the wrong answers just have
gotoAndPlay(X);}
at the end of the quiz I have an empty dynamic text box with the variable "score"
it used to work, add up all the numbers and give me a total. Now I just get NaN....which I understand to mean Not a Number. Why so cruel is the MX? Please explain a better way or what I am doing incorrectly. Thank you much
Giving Flash More Memory
When i go to publish a mp3 file I get a message about Flash is out of memory. How do you give flash more memory? I am using windows 98. I cant seem to find out ho wto do this. any help would be great.
thanks
Giving Controls To A User
We're just about to quote for a job...and was wondering if Flash has the capabilites to allow a user to change the dimensions of an object.
Lets assume its a toy box...can we give three input boxes where the user can enter their choosen length, depth and height of the toy box and flash redraws this?
I could code this in JavaScript and DHTML, but I think Flash would be better.
Finally if it can be done...could it cope with a taper, so the base rectangle of the toy box is slightly smaller than the lid rectangle of the box, creating a taper?
This Form Is Giving Me A Headache
i have a form on my site that loads from a main movieclip. when u click send, its sends the email, but stays on the "waiting for confirmation" frame. when i load it directly (not from the main swf) it works perfect, how do i fix this?
if u dont understand go to http://www.rocketinnovations.ca/skel1.html (then contact)
Giving Users Control
With things like "eval" and such, is there anyway to turn text into a command? I'm thinking of something that lets user edit their own actionscript, but how might you turn the input into commands?
Thanks for the help
[Help]giving Button Action
ok, so ive got my button and wat i want it to do but ive got no idea how to script it to do so
now what i want is wen i click on the button the buble will scroll in from the bottum right to a certain width & once the botton has been clicked it changes so wen i click it again the buble scrolls out
thanks in advance
Giving Input Text A Var Name?
Im trying to create an email form using AS3 and PHP by sending variable names between the two...
However it wont let me enter any value in the Var: part of the properties window and when I try it tells me that this feature is not supported by AS3 and I must target AS1 or 2.
Is there a way of assigning var names to input text fields for sending to php in AS3 or do you have to use a diff method when dealing with PHP in Flash CS3?
Many thanks...
Giving References In Parameters
when giving a parameter to a function, such as a point, the function uses a copy of that point. how do you give a reference instead of a copy?
Giving A 2d Square A 3d Effect
I have a picture that I want to give the feel that, instead of facing the monitor, is turned a bit so that the side closest to you will look bigger than the side furthest away from you. I messed around with the skew, but that really doesn't give the right effect. Does anybody know how this would be done.
If you want an example of what I am talking about, look at itunes (7.1) in there online shopping section. Select movies or cds or something and you will see what I mean. I can figure out how to do everthing else except for the side rotation.
Giving Points... Like In Test
I want an advice...
How can I get points from actionscript... Like in a test... you choose and answer and click the correct answer. How can I make this action to give poitns, and in the end I can see them? Please, tell me the script, how to make it or give me a link to the following problem.
NetStream BytesTotal Giving -1
Hi all.
Doing my nut in as they say over this. I've created some flv's with Squeeze 4.0 and I'm trying to create a load progress bar and play progress bar (in MX2004). However, when I try a simple trace(ns.bytesTotal); all I get is -1 which doesn't bode well for getting the progress bar's to work.
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
my_video.attachVideo(ns);
ns.setBufferTime(5);
ns.play("tooMuchLove_512K.flv");
trace(ns.bytesTotal);
I've tried source the flv off a server, but get the same result.
Any ideas?
Thanks
Rob
Giving My Buttons Inertia...
Hi guys,
Hopefully I can explain well enough here... I have 4 buttons on my stage which sit at 4 random points on the stage. When the mouse moves to the left I want them all to move just a tiny bit to the right as if they are floating, and vice versia. And when one is actually rolled over I wanted to make it look as if it has moved toward the user and the other 3 buttons move back... I don't know if that's a hopeless explanation, I haven't had any luck getting it to work... Any help would be greatly appreciated!
Giving A Name The Number From A For Loop
all I'm trying to do is give the mc a name that is whatever number in the for loop it's in..
_whatever.name = i; right?
i'm getting this error..
1067: Implicit coercion of a value of type int to an unrelated type String.
|