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




SIMPLIED: Rotating .swf Files At Random With ActionScript?



Hi All,

I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:

"base" - bottom layer
"movie" - middle layer
"actions" - top layer

It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.

Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?

Here is the actionscript i placed in the "actions" layer:

Code:
var interval = 20.0;
// delay between rotating images (in seconds)
var random_display = 1;
// 0 = no, 1 = yes
interval *= 1000;
var object_index = 0;
for(var object_index = 0; object_index < num; object_index ++) {

var new objectItem = "/services/pics/r_pic" + object_index + ".swf";
}
var number_of_object = objectItem.length;
function objectItem(object_location) {
this.object_item = new Object();
this.object_item.rObject = object_location;
}
function get_ObjectItemLocation(objectObj) {
return (objectObj.object_item.rObject);
}
function generate(x, y) {
var range = y-x+1;
return Math.floor(Math.random()*range)+x;
}
function getNextObject() {
if (random_display) {
object_index = generate(0, number_of_object-1);
} else {
object_index = (object_index+1)%number_of_object;
}
var new_object = get_ObjectItemLocation(objectItem[object_index]);
return (new_object);
}
function rotateObject(place) {
var new_object = getNextObject();
document[place].rObject = new_object;
var recur_call = "rotateObject('"+place+"')";
setTimeout(recur_call, interval);
}
If anyone knows my mistake, and can help, it'd greatly be appreciated!

Thanks,

Aaron



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-18-2005, 10:53 PM


View Complete Forum Thread with Replies

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

SIMPLIED: Rotating .swf Files At Random With ActionScript?
Hi All,

I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:

"base" - bottom layer
"movie" - middle layer
"actions" - top layer

It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.

Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?

Here is the actionscript i placed in the "actions" layer:

ActionScript Code:
var interval = 20.0;
// delay between rotating images (in seconds)
var random_display = 1;
// 0 = no, 1 = yes
interval *= 1000;
var object_index = 0;
for(var object_index = 0; object_index < num; object_index ++) {

var  new objectItem = "/services/pics/r_pic" + object_index + ".swf";
}
var number_of_object = objectItem.length;
function objectItem(object_location) {
    this.object_item = new Object();
    this.object_item.rObject = object_location;
}
function get_ObjectItemLocation(objectObj) {
    return (objectObj.object_item.rObject);
}
function generate(x, y) {
    var range = y-x+1;
    return Math.floor(Math.random()*range)+x;
}
function getNextObject() {
    if (random_display) {
        object_index = generate(0, number_of_object-1);
    } else {
        object_index = (object_index+1)%number_of_object;
    }
    var new_object = get_ObjectItemLocation(objectItem[object_index]);
    return (new_object);
}
function rotateObject(place) {
    var new_object = getNextObject();
    document[place].rObject = new_object;
    var recur_call = "rotateObject('"+place+"')";
    setTimeout(recur_call, interval);
}

If anyone knows my mistake, and can help, it'd greatly be appreciated!

Thanks,

Aaron

Rotating .swf Files At Random With ActionScript?
Hi All,

I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:

"base" - bottom layer
"movie" - middle layer
"actions" - top layer

It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.

Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?

Here is the actionscript i placed in the "actions" layer:

Code:
var interval = 20.0;
// delay between rotating images (in seconds)
var random_display = 1;
// 0 = no, 1 = yes
interval *= 1000;
var object_index = 0;
object_list = new Array();
object_list[object_index++] = new objectItem("/services/pics/r_pic01.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic02.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic03.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic04.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic05.swf");
object_list[object_index++] = new ObjectItem("/services/pics/r_pic06.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic07.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic08.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic09.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic10.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic11.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic12.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic13.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic14.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic15.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic16.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic17.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic18.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic19.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic20.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic21.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic22.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic23.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic24.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic25.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic26.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic27.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic28.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic29.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic30.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic31.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic32.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic33.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic34.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic35.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic36.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic37.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic38.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic39.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic40.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic41.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic42.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic43.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic44.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic45.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic46.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic47.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic48.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic49.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic50.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic51.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic52.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic53.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic54.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic55.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic56.swf");
var number_of_object = object_list.length;
function objectItem(object_location) {
this.object_item = new Object();
this.object_item.rObject = object_location;
}
function get_ObjectItemLocation(objectObj) {
return (objectObj.object_item.rObject);
}
function generate(x, y) {
var range = y-x+1;
return Math.floor(Math.random()*range)+x;
}
function getNextObject() {
if (random_display) {
object_index = generate(0, number_of_object-1);
} else {
object_index = (object_index+1)%number_of_object;
}
var new_object = get_ObjectItemLocation(object_list[object_index]);
return (new_object);
}
function rotateObject(place) {
var new_object = getNextObject();
document[place].rObject = new_object;
var recur_call = "rotateObject('"+place+"')";
setTimeout(recur_call, interval);
}


If anyone knows my mistake, and can help, it'd greatly be appreciated!

Thanks,

Aaron

Rotating .swf Files At Random With ActionScript?
Hi All,

I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:

"base" - bottom layer
"movie" - middle layer
"actions" - top layer

It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.

Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?

Here is the actionscript i placed in the "actions" layer:

ActionScript Code:
var interval = 20.0;
// delay between rotating images (in seconds)
var random_display = 1;
// 0 = no, 1 = yes
interval *= 1000;
var object_index = 0;
object_list = new Array();
object_list[object_index++] = new objectItem("/services/pics/r_pic01.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic02.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic03.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic04.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic05.swf");
object_list[object_index++] = new ObjectItem("/services/pics/r_pic06.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic07.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic08.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic09.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic10.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic11.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic12.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic13.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic14.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic15.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic16.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic17.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic18.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic19.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic20.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic21.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic22.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic23.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic24.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic25.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic26.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic27.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic28.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic29.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic30.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic31.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic32.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic33.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic34.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic35.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic36.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic37.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic38.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic39.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic40.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic41.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic42.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic43.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic44.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic45.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic46.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic47.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic48.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic49.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic50.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic51.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic52.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic53.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic54.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic55.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic56.swf");
var number_of_object = object_list.length;
function objectItem(object_location) {
    this.object_item = new Object();
    this.object_item.rObject = object_location;
}
function get_ObjectItemLocation(objectObj) {
    return (objectObj.object_item.rObject);
}
function generate(x, y) {
    var range = y-x+1;
    return Math.floor(Math.random()*range)+x;
}
function getNextObject() {
    if (random_display) {
        object_index = generate(0, number_of_object-1);
    } else {
        object_index = (object_index+1)%number_of_object;
    }
    var new_object = get_ObjectItemLocation(object_list[object_index]);
    return (new_object);
}
function rotateObject(place) {
    var new_object = getNextObject();
    document[place].rObject = new_object;
    var recur_call = "rotateObject('"+place+"')";
    setTimeout(recur_call, interval);
}
If anyone knows my mistake, and can help, it'd greatly be appreciated!

Thanks,

Aaron

Rotating .swf Files At Random With ActionScript?
Hi All,

I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:

"base" - bottom layer
"movie" - middle layer
"actions" - top layer

It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.

Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?

Here is the actionscript i placed in the "actions" layer:

Code:
var interval = 20.0;
// delay between rotating images (in seconds)
var random_display = 1;
// 0 = no, 1 = yes
interval *= 1000;
var object_index = 0;
object_list = new Array();
object_list[object_index++] = new objectItem("/services/pics/r_pic01.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic02.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic03.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic04.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic05.swf");
object_list[object_index++] = new ObjectItem("/services/pics/r_pic06.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic07.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic08.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic09.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic10.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic11.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic12.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic13.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic14.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic15.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic16.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic17.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic18.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic19.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic20.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic21.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic22.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic23.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic24.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic25.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic26.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic27.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic28.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic29.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic30.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic31.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic32.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic33.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic34.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic35.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic36.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic37.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic38.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic39.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic40.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic41.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic42.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic43.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic44.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic45.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic46.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic47.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic48.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic49.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic50.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic51.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic52.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic53.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic54.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic55.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic56.swf");
var number_of_object = object_list.length;
function objectItem(object_location) {
this.object_item = new Object();
this.object_item.rObject = object_location;
}
function get_ObjectItemLocation(objectObj) {
return (objectObj.object_item.rObject);
}
function generate(x, y) {
var range = y-x+1;
return Math.floor(Math.random()*range)+x;
}
function getNextObject() {
if (random_display) {
object_index = generate(0, number_of_object-1);
} else {
object_index = (object_index+1)%number_of_object;
}
var new_object = get_ObjectItemLocation(object_list[object_index]);
return (new_object);
}
function rotateObject(place) {
var new_object = getNextObject();
document[place].rObject = new_object;
var recur_call = "rotateObject('"+place+"')";
setTimeout(recur_call, interval);
}
If anyone knows my mistake, and can help, it'd greatly be appreciated!

Thanks,

Aaron

Rotating .swf Files At Random With ActionScript?
Hi All,

I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:

"base" - bottom layer
"movie" - middle layer
"actions" - top layer

It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.

Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?

Here is the actionscript i placed in the "actions" layer:

Code:
var interval = 20.0;
// delay between rotating images (in seconds)
var random_display = 1;
// 0 = no, 1 = yes
interval *= 1000;
var object_index = 0;
object_list = new Array();
object_list[object_index++] = new objectItem("/services/pics/r_pic01.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic02.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic03.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic04.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic05.swf");
object_list[object_index++] = new ObjectItem("/services/pics/r_pic06.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic07.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic08.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic09.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic10.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic11.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic12.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic13.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic14.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic15.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic16.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic17.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic18.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic19.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic20.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic21.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic22.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic23.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic24.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic25.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic26.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic27.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic28.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic29.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic30.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic31.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic32.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic33.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic34.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic35.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic36.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic37.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic38.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic39.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic40.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic41.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic42.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic43.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic44.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic45.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic46.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic47.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic48.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic49.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic50.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic51.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic52.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic53.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic54.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic55.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic56.swf");
var number_of_object = object_list.length;
function objectItem(object_location) {
this.object_item = new Object();
this.object_item.rObject = object_location;
}
function get_ObjectItemLocation(objectObj) {
return (objectObj.object_item.rObject);
}
function generate(x, y) {
var range = y-x+1;
return Math.floor(Math.random()*range)+x;
}
function getNextObject() {
if (random_display) {
object_index = generate(0, number_of_object-1);
} else {
object_index = (object_index+1)%number_of_object;
}
var new_object = get_ObjectItemLocation(object_list[object_index]);
return (new_object);
}
function rotateObject(place) {
var new_object = getNextObject();
document[place].rObject = new_object;
var recur_call = "rotateObject('"+place+"')";
setTimeout(recur_call, interval);
}
If anyone knows my mistake, and can help, it'd greatly be appreciated!

Thanks,

Aaron

Rotating .swf Files At Random With ActionScript?
Hi All,



I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:



"base" - bottom layer

"movie" - middle layer

"actions" - top layer



It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.



Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?



Here is the actionscript i placed in the "actions" layer:


Code:
var interval = 20.0;

Code:

// delay between rotating images (in seconds)

var random_display = 1;

// 0 = no, 1 = yes

interval *= 1000;

var object_index = 0;

object_list = new Array();

object_list[object_index++] = new objectItem("/services/pics/r_pic01.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic02.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic03.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic04.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic05.swf");

object_list[object_index++] = new ObjectItem("/services/pics/r_pic06.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic07.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic08.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic09.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic10.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic11.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic12.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic13.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic14.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic15.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic16.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic17.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic18.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic19.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic20.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic21.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic22.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic23.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic24.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic25.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic26.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic27.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic28.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic29.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic30.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic31.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic32.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic33.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic34.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic35.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic36.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic37.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic38.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic39.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic40.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic41.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic42.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic43.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic44.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic45.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic46.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic47.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic48.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic49.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic50.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic51.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic52.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic53.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic54.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic55.swf");

object_list[object_index++] = new objectItem("/services/pics/r_pic56.swf");

var number_of_object = object_list.length;

function objectItem(object_location) {

this.object_item = new Object();

this.object_item.rObject = object_location;

}

function get_ObjectItemLocation(objectObj) {

return (objectObj.object_item.rObject);

}

function generate(x, y) {

var range = y-x+1;

return Math.floor(Math.random()*range)+x;

}

function getNextObject() {

if (random_display) {

object_index = generate(0, number_of_object-1);

} else {

object_index = (object_index+1)%number_of_object;

}

var new_object = get_ObjectItemLocation(object_list[object_index]);

return (new_object);

}

function rotateObject(place) {

var new_object = getNextObject();

document[place].rObject = new_object;

var recur_call = "rotateObject('"+place+"')";

setTimeout(recur_call, interval);

}




If anyone knows my mistake, and can help, it'd greatly be appreciated!



Thanks,



Aaron

Rotating .swf Files At Random With ActionScript?
Hi All,

I'm trying to accomplish getting actionscript to load an independant .swf file into a MC at random every 20 secs? I've created the .swf files to be loaded into the MC to which I gave it an instance name of "rObject". I created 3 layers:

"base" - bottom layer
"movie" - middle layer
"actions" - top layer

It's pretty obvious that I placed the transparent MC in the "movie" layer, actionscript code into frame 1 of the "actions" layer, and the remaining "base" layer is what it states, a base or background.

Now, I don't know if something is wrong or missing inside the code? Or, maybe i have to place additional code onto the "rObject" MC?

Here is the actionscript i placed in the "actions" layer:

ActionScript Code:
var interval = 20.0;
// delay between rotating images (in seconds)
var random_display = 1;
// 0 = no, 1 = yes
interval *= 1000;
var object_index = 0;
object_list = new Array();
object_list[object_index++] = new objectItem("/services/pics/r_pic01.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic02.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic03.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic04.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic05.swf");
object_list[object_index++] = new ObjectItem("/services/pics/r_pic06.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic07.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic08.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic09.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic10.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic11.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic12.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic13.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic14.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic15.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic16.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic17.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic18.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic19.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic20.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic21.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic22.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic23.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic24.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic25.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic26.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic27.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic28.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic29.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic30.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic31.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic32.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic33.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic34.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic35.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic36.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic37.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic38.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic39.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic40.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic41.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic42.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic43.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic44.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic45.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic46.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic47.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic48.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic49.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic50.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic51.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic52.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic53.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic54.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic55.swf");
object_list[object_index++] = new objectItem("/services/pics/r_pic56.swf");
var number_of_object = object_list.length;
function objectItem(object_location) {
    this.object_item = new Object();
    this.object_item.rObject = object_location;
}
function get_ObjectItemLocation(objectObj) {
    return (objectObj.object_item.rObject);
}
function generate(x, y) {
    var range = y-x+1;
    return Math.floor(Math.random()*range)+x;
}
function getNextObject() {
    if (random_display) {
        object_index = generate(0, number_of_object-1);
    } else {
        object_index = (object_index+1)%number_of_object;
    }
    var new_object = get_ObjectItemLocation(object_list[object_index]);
    return (new_object);
}
function rotateObject(place) {
    var new_object = getNextObject();
    document[place].rObject = new_object;
    var recur_call = "rotateObject('"+place+"')";
    setTimeout(recur_call, interval);
}


If anyone knows my mistake, and can help, it'd greatly be appreciated!

Thanks,

Aaron

Rotating An MC With Random Movement
I have a man randomly moving around the stage, but would like to get the movie clip of him to move to frame 2 if he goes left, frame 3 if he goes right, etc

I'm pulling my hair out,............please help!

Rotating Mov Files
I currently have a movie file that when you hit the buttons it pulls in seperate mov files. Is it possible to work it so that the movies that get pulled in via the buttons rotate every 45 seconds.

Also is there a way that the buttons could change colour once pressed.

I have attached the file as I'm not that fluent in Flash and it may be hard to understand.

Rotating Mov Files In Empty Mov
I have a empty mov on the scene 1 which pulls in different movies when you click on buttons works fine. I want to have the movies rotate every 8seconds can't find a way to do this.

I did make a timeline on the scene which every second called in the next mov eg 1 then 2, 3, 4, but this ruins the over state on my buttons.

Rotating GetURL... Random Page Loading From List
I'm not really sure how to explain it in the title, so I'll do my best here..
I have two pages that load: 1.html and 2.html. The index.html page has the actionscript version of the Flash Player Detection Kit. When Flash 8 is detected, it succesfully redirects from index.html to 1.html (if not detected, noflash.html). Now, here's what I want it to do. I don't want it to ALWAYS redirect to 1.html when it's detected... I want it to randomly choose either 1.html or 2.html (and eventually 3.html) to redirect to. Is it possible to do this using the actionscript version of the detection kit? If so, how?

Rotating Header - Load Random External .swfs
Ok...I asked this over at Kirupa and got some great advice that has me on my way but I'm stuck because there are really too many ways to skin this cat.

Could anyone point me in the right direction on this:

I'd like to make a "main" flash movie to load external .swfs.
It's not a problem to make it load a random external .swf but how could I make the loaded .swfs randomly load another .swf on the root at the end of its timeline?

Thanks

-----joe

Rotating Header - Load Random External .swfs
Could anyone point me in the right direction on this:

I'd like to make a "main" flash movie to load external .swfs.
It's not a problem to make it load a random external .swf but how could I make the loaded .swfs randomly load another .swf on the root at the end of its timeline?

Thanks

-----joe

Rotating Flash Files 90 Degrees
Is it possible to rotate a flash file 90 degree clockwise or counter clockwise?

I am asking because my new phone supports flash and I want to game to fill the entire screen (240 x 320 resolution).

Thanks a lot for any help

Rotating MC Using Actionscript
Hi, I have a MC which is a circle divided into six segments. I have three buttons. A left arrow, a right arrow and a select button.
For now I am just working on the right arrow. Basicaly, when I press this button I want my MC to rotate 60 degrees at a step of 2 degrees every enter frame event.
This is the code in my MC

Code:
onClipEvent(enterFrame){
if((_root.RotatingCW == true) && (_root.Options._rotation != _root.NewPosition)){
_root.Options._rotation += 2;
}else{
_root.RotatingCW = false;
_root.OldPosition == _root.NewPosition;
}
}


This is the code in my button

Code:
on(press){
if(RotatingCW == false){
_root.OldPosition = _root.Options._rotation;
_root.NewPosition = (_root.OldPosition + 60);
_root.RotatingCW = true;
}
}


Everything works fine for the first three clicks until my MC has rotated 180 degrees. The next click it just keeps rotating. I can see that the _rotation value of the MC is going backward after 180 degrees but I am not sure how to code for it. I would apreciate any help.
Thanks Lee.

Rotating Actionscript ?
hey there

i have this image of a shiva ( 6 armed woman)

im trying to give the arms a little movement, to make it come alive abit.

what ive done is; i made a png-24 file in photoshop of one of the arms. I gave it a transparant background, and i imported the png in flash.

When i tried to rotate it , with the shoulder as centre; the arm did some really wierd things. The rotation is ok but the colors of the arm are messed up, it looks like a moving water effect on the picture.

when i try to rotate the arm with the rotate option in the tween properties ( 1 time CW ) it rotates very smooth and i dont see that water effect in the arm.
but i cant use this because i only need the arm to rotate 10-15 degrees.

why are those pixels so messed up with a normal tween?

should i use actionscript to let those arms move?

if yes, some tutorials are always welcome.


thx in advance
grtz

Rotating With Actionscript
I have a symbol graphic I want to animate over the top of a logo. It's just a faded beam of light so it looks like the logo is spakling, if you know what I mean.

Anyways, I want to make this symbol randomly rotate around the logo. Any ideas how I can do this?

I am not sure what the mething is for rotating things in action script.

Thanks

Laura

Help Rotating With Actionscript
Hi there.
I been having a really hard time trying to rotate a mc, I am using this actionscript code

onClipEvent (load) {
radius=100;
xcenter=250;
ycenter=200;
angle=0;
speed = 5;
}
onClipEvent (enterFrame) {
_x = Math.cos(angle*Math.PI/180)*radius+xcenter;
_y = Math.sin(angle*Math.PI/180)*radius+ycenter;
angle += speed;
if (angle>359) {
angle -= 360;
}

}

what I am trying to do is be able to controll this, with buttons.
What I mean is if I press a button this mc will rotate and stop at some determinate grade, and if I click in another button the same mc will play in reverse or in a normal way, depents of the angle that I want to.
sorry about my english.
I am not a native english speaker.

Thank you for your help.

Alejandro

Rotating A Movie Containing Actionscript
Hi

I have a movieclip which contains some cars which move around using actionscript.

In the main movie I have put an instance of this movie and it works fine. However when I try to rotate the movieclip it then stops working.

Is there a way I can rotate a movieclip and still let the actions inside it run.

Thanks

Rotating A Movieclip That Contains Actionscript
Hi

I have a movieclip which contains some cars which move around using actionscript.

In the main movie I have put an instance of this movie and it works fine. I can resize this movie and it still works, however when I try to rotate the movieclip it then stops working.

Is there a way I can rotate a movieclip and still let the actions inside it run.

Please help, thanks

Rotating Object With Actionscript
Okay, let's see if I can explain what I want to do and how I've tried to do it:

I have a movie clip (call it Box1) I want the user to be able rotate when they click and drag a button (call it "dragger"). The graphic inside Box1 is off center (the center is actually in the upper left corner of the graphic) and the button "dragger" must stay exactly in the same position in relation to Box1, in this case in the upper right corner.

I've tried doing this in two ways, one doesn't work the way I want it to and the other I can't get to work right at all.

Version 1:
"Dragger" is a button imbedded in a movie clip. The button is set to turn a variable "drag" on or off, depending on if the button is pressed or released. On the clip "dragger" that the button is in, i have this code:

onClipEvent (enterFrame) {

if (_parent.drag) {
mouseX = _root._xmouse;
mouseY = _root._ymouse;
theta = 180 * (Math.atan2(mouseY, mouseX))/Math.PI;
if (mouseX < 0) theta += 180;
if (mouseX>=0 && mouseY < 0) theta +=360;
_parent._rotation = theta;
}

This works more or less, but when you first click on the button, the angle theta come up to 8.5 degrees, so Box1 suddenly jumps to that rotation angle. I want the button to track on the mouse and rotate Box1 evenly without skipping.

Version 2:
Well, this is much more complicated, but I followed a script I found on ultrashock.com that showed how to constrain an object to a circle, in this case the button clip "dragger" using this code:

onClipEvent (enterFrame) {
constrainer = _parent._parent.constrainer;
if (_root.drag) {
pX = _parent._parent._xmouse;
pY = _parent._parent._ymouse;
} else {
pX = _parent._x;
pY = _parent._y;
}
radius = constrainer._width/2;
modX = pX - constrainer._x;
modY = pY - constrainer._y;
hypotenuse = Math.sqrt(modX * modX + modY * modY);
theta = Math.atan2(modY, modX);
rotate = theta*360/(2*Math.PI);
percent = radius/hypotenuse;
pX = modX * percent;
pY = modY * percent;
_parent._x = pX + constrainer._x;
_parent._y = pY + constrainer._y;
_parent._rotation = rotate;
}

This works great in getting the button to move and rotate evenly. My only problem was using any of the above info to rotate Box1, with "dragger" inside of it or not.

Any help would be greatly appreciated. Thanks!

grayehound

Help Rotating An Object With Actionscript
I posted earlier for help on this, but eventually figured it out myself...at least to some degree. Now I need help making it work the way I had in mind. In the attached .fla file I have a blue box that can be rotated on an offset axis when you drag a button on the box. That part works great, though I would like to know if there is some way to make it run smoother. The real problem I ran into is what I want to have happen if the button is released in the middle of the turn. As it is now, the box starts a 0 degrees and can be rotated down to 90 degrees. What I wanted to happen was if the box began in the up position and the user starts dragging down and releases somewhere between 10 and 80 degrees, it continues down. If the box begins down and is dragged up a ways, it continues up. As it stands now, the box reacts nothing like this, though I thought my script would work.

If anyone has any suggestions on how I can make this work better, I'd appreciate it! That includes any ideas on how I could make the rotating look smoother, if at all possible. Thanks in advance!

grayehound

Rotating Circle Using Actionscript
ok, the title isnt exactly correct, because i dont want to rotate the circle. rather, i want to start with an arc of the circle and have that increase in size until it becomes a full circle
i want to sync this with a sound that I am playing. I know i can use sound.position divided by sound.length to determine how far along the sound is, but i need to know how to somehow translate this into a command to make the circle change size.
any help is appreciated...i think i might be able to do it with an actual movie, and each frame has a larger arc of the circle, but id rather do it with actionscript

thnx

Rotating Globe ActionScript
Hey everyone i am fairly new to using flash, so am having problems with a project.

I have created a rotating globe in a 3d program and imported it into flash. There are 100 different images on 100 different frames to give the rotating affect.

I want to be able to click on a country which will load a new window no matter what position the globe is in. Basically each major country like America, Australie etc. should be clickable.

I have no idea how to go about achieving this.

Can anyone help?

Thanks
Robert

Help: Actionscript For Rotating A Cube.
Hi Kirupa/ kiupians,

I'm new here. Writing in knowing that my inquiries will be answered.

Question: Is there an actionscript I can insert to create the animation/movement of a cube flipping/rotating vertically?

I hope you can help me by providing a simple solution.

Many thanks!

Fion

Help: Actionscript For Rotating A Cube.
Hi Kirupa/ kiupians,

I'm new here. Writing in knowing that my inquiries will be answered.

Question: Is there an actionscript I can insert to create the animation/movement of a cube flipping/rotating vertically?

I hope you can help me by providing a simple solution.

Many thanks!

Fion

Rotating A Ball By Actionscript..
Hi guys,

Can you please help me..
I need an actionscript that can rotate a small ball around another Mc. I do not want to use the _rotate function, because then I won't be able to place the ball in centre of it's Mc.

Thanks in advance.

Rotating With Ease In Actionscript
Hi,

I'm trying to rotate an object in flash with actionscript. Every time I click a button the object has to rotate 390 degrees (meaning it has to make more than a full rotation).

When I do a rotation of only 30 degrees it works fine. But when I change it to for examle 100 degrees, after a few clicks it goes crazy and keeps rotating. The higher the angle it has to rotate, the faster it goes crazy. When I put the rotation on 390 degrees it goes crazy almost every time I click.

With this code I make the movieclip rotate with easing:

Root.button1.onRelease = function(){
startRotation = Root.disc_mc._rotation
target = (startRotation - 30);
Root.disc_mc.onEnterFrame = function() {
difRot = target-this._rotation;
if (difRot<-359){
difRot +=360
}
this._rotation += difRot/5;
if((difRot < 0.1) && (difRot > -0.1)) {
delete this.onEnterFrame;
}
};
}

This code works fine here, but when I change "target = (startRotation - 30);" to "target = (startRotation - 100);" or "target = (startRotation - 390);" it's messed up because it keeps rotating.

If anybody has a sugestion, it would be much appreciated.

Thanx in advance,

Dries

Actionscript For Rotating Images....urgent
I gave this file for my freind to modify and he used code which Im not very used to...basically the creatures are supposed to rotate 'around' the title and not really touch it but when the images do rotate it all goes messy.

If anyone could do It, it would really help me out alot!

LINK: http://rapidshare.com/files/61657564...600_3.fla.html

Rotating A Ball In 3d With A Logo On It Using Actionscript.
Hi everyone,

Okay - I think this is a bit of a tough one.

I'm developing a 3d game involving a ball. The client wants their logo on the ball, so when the ball rotates, it needs to appear as if the logo rotates with it (ie: as if the logo is printed on the ball).

The ball is going to be bouncing off all kinds of surfaces and going all over the place, so I can't just create a 3d model and export a load of rotated images as I'd end up with a ridiculous amount of images.

So, where I am so far is....

I have a ball, with the logo on it, and a mask around it so that if I move the logo up or down it appears to disappear of the edge of the ball (as it would). By altering the _xscale and _yscale of the logo I also increase the realism of the logo disappearing round the side of the ball.

But, then I'm stuck. It looks great if the ball is rolling "away" from you but then as soon as it hits an angles surface and bounces off, the sideways rotation comes into play too and then I'm stuck.

I'm presuming there is a way to do this reasonably realistically. I know the x and y increase of my ball at any one time, and based on that I can obviously calculate the angle at which the ball is travelling.

Am I trying to do the impossible here or does anyone know whether there are any examples out there etc...?

Thanks in advance for any help.

Cheers.

Ian

Spining/rotating An Object In Actionscript? =o)
Hi guys,

Sorry to be a pain in the ass with this little query, it's for a University project though

I just want a looped full rotation / spinning of a library object, but with actionscipt?

Many thanks in advance =o) You guys are legends!

(i looked but this wasn't in the 500 threads list!)

Tom - 21 - UK

Rotating Dynamic Text Box In Actionscript
I have created a dynamic textbox using actionscript, and am trying to rotate it:

_root.axis.createTextField("labelY", -1, -1, -16, 10, 20);
_root.axis.labelY.embedFonts = true;
_root.axis.labelY.text = labelY;
_root.axis.labelY.setTextFormat(labelYFormat);
_root.axis.labelY._rotation = 90;

When i run this, the text disappears, and when I remove the rotation line it still does not appear. I'm sure it has something to do with the embedFonts method, because when I remove this line along with the rotation line, it displys. IO'm pulling my hair out here!!!

A computer always does what you tell it to, but rarely does what you want it to.....

Rotating Text Variables On A Banner Using Actionscript
I am trying to create a banner that lists 25 different words that fade in and fade out one by one. I know I can create this using Swish but I wanted to understand how to do it in actionscript. I tried creating a text variable and setting the variable at the correct frames but the word does not show up.

Any fast ideas?

Looking For Actionscript Or A Component For Smooth 3d Rotating Of An Object.
Looking for actionscript or a component for smooth 3d rotating of an object.

Thanks

(MX) Actionscript Alternative (rotating Title Text)
Hey all.

Been working on some clients sites and come across a little bump in my creative road, i have basically pulled off a animation, of title text rotating when a menu button is selected.

But to get this effects right , many frames had to be used and i feel that i dont have much control with this method and if i was too add buttons would be tedious to create another 20 or so frames, so i was curious on how would i achieve this animation in actionscript. (see attached fla for reference)

My guess would be along the lines, of a function that controls the x and y cooridinates , probably using a pie or diameter equation to control movement and updated dynamic text. "in theory" but practical how?

thanks for any assistance.

Actionscript, Text Scrolling / Rotating Dial... Please Help << Urgent
Hi, I have a dial, it rotates and everything like that works..
I want it to control a textbox's scrolling.. i made some code so when the dial turns, a variable is added/subtracted from (based on the current-previous _rotation property), and when the variable reaches 10 or -10, then it scrolls the textbox once back or forward..
The rotation goes from 0 to 180 and to -180..

The problem is, when i rotate, everything scrolls fine until i reach halfway (the 180 point) and then it scrolls backwards one line..

know why this happens? know any solution?

Thanks.

[F8] Rotating A Movie Clip (countdown Timer) Using Actionscript
I have a MC of a clockface that will be used as a countdown timer. The angle of the needle on the face is controlled using the _rotation command. See attached example.

For reasons that I won't go into, I need to have the clock MC on several different frames - each with a unique initial value (ie the needle pointing in a different direction). This initial value is the variable "startAngle" located at each frame.

If the MC jumps to the first instance of the clock (frame 1) then all is well - however, if it jumps to any subsequence frames (frame 2) the value for the _rotation is ignored...and the needle doesn't move.

Any ideas, 'cause I've run out and it's doing my head in...

Basic Moving Clip W/actionscript + Random Motion W/actionscript
ive tried this many times w/logical scripts but i dont know how

how do you create motion w/actionscript?

also, how do you randomize the motion?

any help would be appreciated

Random Swf Files
We are currently creating a flash project with students work and we are trying to create a simple flash file that will load a random .swf files and unload the previous one to create a random gallery of work but not getting there can any one help.

Should have said that there are no interactive buttons this will run as stand alone projecting various bits of student work for open days.

.swf Files At Random?
A person at Macromedia forums gave me this, stating that
following actionscript code below should do what I want it to do with regaurds to getting the .swf files to rotate at random. I’m sure it does work according to how he coded it. But I think he has misunderstood my labeling of my .swf files for rotation? My .swf file start at “r_pic01.swf”, and end at “r_pic56” making a total of 56 .swf files. From observing his code; line 12 of the code gives the number 57 being the highest possible number. When the highest number should be 56. Also I think he failed to realize that my files number values are 01,02,03…ect,ect when less than the value of 10. If I am correct on this suspect mistake, can it be fixed accordingly so that it will work?


Code:
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
var intervalVar = 20.0;
// delay between rotating images (in seconds)
object_list = new Array();
for (var ivar = 0; ivar<57; ivar++) {
if (ivar<10) {
object_list[ivar] = new objectItem("/services/pics/r_pic0"+ivar+".swf");
} else {
object_list[ivar] = new objectItem("/services/pics/r_pic"+ivar+".swf");
}
}
object_list.shuffle();
_root.createEmptyMovieClip("targetMC", _root.getNextHighestDepth());
loadI = setInterval(loadF, intervalVar*1000);
function loadF() {
if (!repeatCall) {
repeatCall = 0;
}
targetMC.loadMovie(object_list[repeatCall]);
repeatCall++;
if (repeatCall>=object_list.length) {
clearInterval(loadI);
}
}
Thanks,

Aaron

.swf Files At Random?
A person at Macromedia forums gave me this, stating that
following actionscript code below should do what I want it to do with regaurds to getting the .swf files to rotate at random. I’m sure it does work according to how he coded it. But I think he has misunderstood my labeling of my .swf files for rotation? My .swf file start at “r_pic01.swf”, and end at “r_pic56” making a total of 56 .swf files. From observing his code; line 12 of the code gives the number 57 being the highest possible number. When the highest number should be 56. Also I think he failed to realize that my files number values are 01,02,03…ect,ect when less than the value of 10. If I am correct on this suspect mistake, can it be fixed accordingly so that it will work?


ActionScript Code:
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
var intervalVar = 20.0;
// delay between rotating images (in seconds)
object_list = new Array();
for (var ivar = 0; ivar<57; ivar++) {
if (ivar<10) {
object_list[ivar] = new objectItem("/services/pics/r_pic0"+ivar+".swf");
} else {
object_list[ivar] = new objectItem("/services/pics/r_pic"+ivar+".swf");
}
}
object_list.shuffle();
_root.createEmptyMovieClip("targetMC", _root.getNextHighestDepth());
loadI = setInterval(loadF, intervalVar*1000);
function loadF() {
if (!repeatCall) {
repeatCall = 0;
}
targetMC.loadMovie(object_list[repeatCall]);
repeatCall++;
if (repeatCall>=object_list.length) {
clearInterval(loadI);
}
}
Thanks,

Aaron

.swf Files At Random?
A person at Macromedia forums gave me this, stating that
following actionscript code below should do what I want it to do with regaurds to getting the .swf files to rotate at random. I’m sure it does work according to how he coded it. But I think he has misunderstood my labeling of my .swf files for rotation? My .swf file start at “r_pic01.swf”, and end at “r_pic56” making a total of 56 .swf files. From observing his code; line 12 of the code gives the number 57 being the highest possible number. When the highest number should be 56. Also I think he failed to realize that my files number values are 01,02,03…ect,ect when less than the value of 10. If I am correct on this suspect mistake, can it be fixed accordingly so that it will work?


Code:
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
var intervalVar = 20.0;
// delay between rotating images (in seconds)
object_list = new Array();
for (var ivar = 0; ivar<57; ivar++) {
if (ivar<10) {
object_list[ivar] = new objectItem("/services/pics/r_pic0"+ivar+".swf");
} else {
object_list[ivar] = new objectItem("/services/pics/r_pic"+ivar+".swf");
}
}
object_list.shuffle();
_root.createEmptyMovieClip("targetMC", _root.getNextHighestDepth());
loadI = setInterval(loadF, intervalVar*1000);
function loadF() {
if (!repeatCall) {
repeatCall = 0;
}
targetMC.loadMovie(object_list[repeatCall]);
repeatCall++;
if (repeatCall>=object_list.length) {
clearInterval(loadI);
}
}
Thanks,

Aaron

.swf Files At Random?
A person at Macromedia forums gave me this, stating that
following actionscript code below should do what I want it to do with regaurds to getting the .swf files to rotate at random. I’m sure it does work according to how he coded it. But I think he has misunderstood my labeling of my .swf files for rotation? My .swf file start at “r_pic01.swf”, and end at “r_pic56” making a total of 56 .swf files. From observing his code; line 12 of the code gives the number 57 being the highest possible number. When the highest number should be 56. Also I think he failed to realize that my files number values are 01,02,03…ect,ect when less than the value of 10. If I am correct on this suspect mistake, can it be fixed accordingly so that it will work?


Code:
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
var intervalVar = 20.0;
// delay between rotating images (in seconds)
object_list = new Array();
for (var ivar = 0; ivar<57; ivar++) {
if (ivar<10) {
object_list[ivar] = new objectItem("/services/pics/r_pic0"+ivar+".swf");
} else {
object_list[ivar] = new objectItem("/services/pics/r_pic"+ivar+".swf");
}
}
object_list.shuffle();
_root.createEmptyMovieClip("targetMC", _root.getNextHighestDepth());
loadI = setInterval(loadF, intervalVar*1000);
function loadF() {
if (!repeatCall) {
repeatCall = 0;
}
targetMC.loadMovie(object_list[repeatCall]);
repeatCall++;
if (repeatCall>=object_list.length) {
clearInterval(loadI);
}
}
Thanks,

Aaron

.swf Files At Random?
Hi,

A member at Macromedia forums gave me this stating that the following actionscript code below should do what I want it to do with regaurds to getting the .swf files to rotate at random. I’m sure it does work according to how he coded it. But I think he has misunderstood my labeling of my .swf files for rotation? My .swf file start at “r_pic01.swf”, and end at “r_pic56” making a total of 56 .swf files. From observing his code; line 12 of the code gives the number 57 being the highest possible number. When the highest number should be 56. Also I think he failed to realize that my files number values are 01,02,03…ect,ect when less than the value of 10. If I am correct on this suspect mistake, can it be fixed accordingly so that it will work?

Code:
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
var intervalVar = 20.0;
// delay between rotating images (in seconds)
object_list = new Array();
for (var ivar = 0; ivar<57; ivar++) {
if (ivar<10) {
object_list[ivar] = new objectItem("/services/pics/r_pic0"+ivar+".swf");
} else {
object_list[ivar] = new objectItem("/services/pics/r_pic"+ivar+".swf");
}
}
object_list.shuffle();
_root.createEmptyMovieClip("targetMC", _root.getNextHighestDepth());
loadI = setInterval(loadF, intervalVar*1000);
function loadF() {
if (!repeatCall) {
repeatCall = 0;
}
targetMC.loadMovie(object_list[repeatCall]);
repeatCall++;
if (repeatCall>=object_list.length) {
clearInterval(loadI);
}
}
Thanks,

Aaron

.swf Files At Random?
Hi,

A member at Macromedia forums gave me this stating that the following actionscript code below should do what I want it to do with regaurds to getting the .swf files to rotate at random. I’m sure it does work according to how he coded it. But I think he has misunderstood my labeling of my .swf files for rotation? My .swf file start at “r_pic01.swf”, and end at “r_pic56” making a total of 56 .swf files. From observing his code; line 12 of the code gives the number 57 being the highest possible number. When the highest number should be 56. Also I think he failed to realize that my files number values are 01,02,03…ect,ect when less than the value of 10. If I am correct on this suspect mistake, can it be fixed accordingly so that it will work?


ActionScript Code:
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
var intervalVar = 20.0;
// delay between rotating images (in seconds)
object_list = new Array();
for (var ivar = 0; ivar<57; ivar++) {
if (ivar<10) {
object_list[ivar] = new objectItem("/services/pics/r_pic0"+ivar+".swf");
} else {
object_list[ivar] = new objectItem("/services/pics/r_pic"+ivar+".swf");
}
}
object_list.shuffle();
_root.createEmptyMovieClip("targetMC", _root.getNextHighestDepth());
loadI = setInterval(loadF, intervalVar*1000);
function loadF() {
if (!repeatCall) {
repeatCall = 0;
}
targetMC.loadMovie(object_list[repeatCall]);
repeatCall++;
if (repeatCall>=object_list.length) {
clearInterval(loadI);
}
}


Thanks,

Aaron

Random Uploading Swf Files
Can sombodey please help me!

I need to make a SWF that random loads swf's each time people visite our site.
Every time that they'll visite, they should see a other SWF.

PLEASE!!!

Selecting Random .swf Files
My code loads random movie clips from the same folder of the files "17_1.swf", "17_2.swf" and so on to "17_50.swf". If I have files that don't start with "17_" but I would like to load them anyway without having to change all of these file names, is there a better way for me to write this code?

In other words, how can I simply have it load all of the movie clips in its folder rather than just the ones named appropriately?

Thanks







Attach Code

BTNnext_btn.onRelease=function(){
MCempty_mc.loadMovie("17_"+ (Math.floor(Math.random() * 50) + 1) + ".swf", "_root.movieclip");

Calling Random FLV Files
Hi,

I learnt how to embed external video lately by using media playback component.

It will be very kind if someone can tell me how i can call muliple .flv files one after other randomly

What I want to do actually is somthing like the promo video on http://msn.co.in

Incase there are any other or tutorials, plz advise.

Thanks in advance,
Tommcat

Playing Random Flv Files
Hi all,

Im really struggling with this, what it is I am trying to make something in flash that will load a random flv when a web page is refreshed, I have done it using swf files befroe but I need it to do the same with flv.

can anyone point me in the direction as to where I amy find a good tutorial for doing this.

Thanx in advance
Rob

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