How Do You Apply An ALT To A SWF Embed?
Apparantly it's possible to use java script to apply an ALT to an SWF embed for people who don't have Flash player installed.
I can't find anything about it though, does anyone know how to do it?
Or is there another way to avoid people who don't have the player installed from seeing a big a grey box where the movie should be?
SitePoint > Design Your Site > Flash and Actionscript
Posted on: Apr 24, 2008, 05:17
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Changes Won't Apply...
When ever I use a tool, I do stuff with it... but when I release the mouse button, the changes undo themselves. For example, I'd erase something, then release the button, and the thing would just pop back up. How do I fix this?
Apply
Hi, the main movie of my website loads the following movies:
loadMovieNum("main_menu.swf", 10);
loadMovieNum("news.swf", 2);
loadMovieNum("grid.swf", 1);
I have a button on mc "main_menu.swf". When this button is pressed I want mc "grid.swf" to:
gotoAndPlay('play');
I have been trying "_root.grid.gotoAndPlay('play');" amongst others but no joy.
Is this possible?
many thanks
Object And Embed Or Maybe Just Embed?
Can you solve the mystery for me. For years now I have put Flash objects into html pages by using the OBJECT tag and EMBED tag. I have placed the EMBED tag inside the OBJECT tag to make sure every browser sees the flash as recomended.
I am working on a Content Management System which allows the user to insert flash objects to the pages being managed.
As some of you may hae experienced the MSHTML editor (often used in WYSIWYG online editors like editworkspro.com) actually rewrites the object code which causes problems.
I have found one solution. The code is not rewritten if you only insert the embed tag - so skip the object tag surrounding it.
For some reason that works and IE (version 6 at least) can see the flash object. I thought the object tag was required!!
Now can someone tell me why the object tag is not required! And if It would be safe for me to skip it from now on.
Regards,
Sambo
This code works for an example in IE 6.
Code:
<*EMBED
pluginspage=http://www.macromedia.com/go/getflashplayer
src=flashfile.swf
width=295
height=328
type=application/x-shockwave-flash
quality="high"
bgcolor="#F2F4EE"
MENU="false">
<*/EMBED>
The * is just so that the board doesn't try to render the flash
How To Apply A Preloader
I have a flash movie which is big in size. I want a preloader to run it. So now I made twoflash files. One heavy main file and one small flash file. Now how to make to small flash file run till the larger main file loads. I think I have to use an Applet, but which one and how I do not know? Please help
siddharth
Please Help- I Have A Concept And I Don't Know How To Apply It
Hello
I have this concept for my portfolio site which is a mix of flash and html graphics-
I want my flash movie to be semi faded when the mouse it not over it but when the mouse goes over it, it is fully shown-
I know this can be done trhough telltarget/with with a movie clip- and a invisible buttom-
but that means I have to put a big invis. buttom on my movie and that will make the whole area clickable which i don't want-
is there a way to do it with clipevent or something- please help me out or direct me to a tutorial that shows this
thnx
I Have This Concept And Don't Know To Apply It
Hi, I have this idea for my site and don't know how to apply it
My web site is half html images and half flash- I want to make the flash parts semi tranparent but when the mouse goes over it they would be fully shown- what i have done is i made put a M/C on the top of my movie timeline and used tell target to control the look of it- this part i have no problem with-
but the part i have problems with is how to control the m/c
i tried the invis. buttons but that would make the whole flash part clickable which is not what i want- i tried onclip event but it doesn't work as good as I wanted it to work-
any suggestion-
I also thought of having a timer if the mouse is not active in X- sec tell target/with my white MC. but i don't know how to do that either.
please help me thnx shane
Please Tell Me How Apply THIS Technique
I saw this website
http://www.craigdavid.co.uk/site/home.php
and I really like the technique used for the sliding banner. Could anyone give me a clue how they did that please? I think it seems like a popular technique now
Thank you very much
Peddie
Apply Stroking
Is there a way to apply a stroke to an object in Flash?
How To Apply Javascript
Great thanks to Nordberg for supplying the following javascript to open a file in a new seperate window sized 500 x 250.
on (release) {
screenX = System.capabilities.screenResolutionX
screenY = System.capabilities.screenResolutionY
getURL("java script:NewWindow=window.open('yourpage.asp','windo wname','width=500,height=250,top="+((screenY -250)/2)+",left="+((screenX -500)/2)+" ,toolbar=No,location=No,scrollbars=No,status=No,re
sizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
Only problem is,I don't know what to do with it. I tried inserting into the getURL action field and it woudn't take it. I tried using expert mode and it said there's errors in the code when trying to get back to normal mode.
Also do I need to replace my file name with 'yourpage.asp' or 'windowname'?
Anyone know how or where to insert this code?
Thanks!!!!!!!!!!!!!!!!
Apply Function
Hi
I've built a tree menu.
when u click on a button it changes its font color and it's being underlined.
I've done that by using the button text as html and then on(release) set the different variables to the html code needed. This works very fine, only if i add another buttton to the tree menu i have to change the script of all the 30 other buttons too.
Now i had an idea, maybe i could define a function with resets all html codes to the starting position
if i click on a button flash should
run the function
and then set the code of the clicked button
to do that i've added a script in the first frame
function reset() {
a = "hallo";
b = "you";
}
if i click on button A
on (release){
run reset ( dont know how to do that)
a = "<font color = "#FFFFFF"><u>hallo</u></font>"
}
but what script do i need to run reset????
seems complicated but it isn't
mainly i ask u what script do i need that a button executes a function??
thanx a lot
Gilo
Batch Apply?
I´m in the making of a site, and i´ve got many pictures, that should fade in from alpha 50% to 100%. I´ve used the motion-tween and put it in a Movie Clip a million times. Is it possible to make some kind of batch apply on these pictures???? (imported jpegs, converted to bitmap, finally converted to grapich)
NEED HELP PLEASE.
MightyDane
Apply #include On The Fly
Hi
I have a menu that I'm trying to automize. In its present state, there are thumbnails already on the stage and I'm using #include to reference a separate *.as file that gives the thumbs behaviours.
Now instead I'm using attachMovie to create the thumbs. How can I apply a #include to the created thumbs using script?
Is there a simple way to do it using a class?
thanks
mark
flash8
Apply Some Pressure
Hi people,
Does anyone know how liquid crystal sheets work at all?
if not i will try and explain it. This sheet could be as big as A4 sized paper, visually, it looks black, nothing else. but if you where to place your hand on this sheet, the heat from your hand will effect the black ink, by fading to clear ( possibly to reveal the original colour underneath ) in this process of revealing of depending upon how long the hand is placed, a heat pattern, colours fading from red to green to slightly orange/brown.
now my question is i would like to replace the hand for the mouse cursor. so if i leave the mouse cursor in the same place it will cause a reaction and if you move the mouse cursor slowly left to right it leaves a trail behind.oh and the effect will always return to its original stat, which is black.
any indeas and if this is possible??
heres a link to what an lcr sheet is http://www.teachersource.com/catalog...aca7e1138bcde2
cheers
[F8] Why The FK Doesn't This CSS Apply?
I don't have much experience dealing the styles in flash but for some dumbfk reason, there are no underlines on <a> tags by default so I have to style them in. Pain in the arse.
Anyway, this seems simple enough but doesn't do sh*t.
Code:
import TextField.StyleSheet;
var mySS = new StyleSheet();
mySS.setStyle("hyper", {color:'#00FF00',fontWeight:'bold'});
myText = createTextField("myText",0,0,0,0,0);
myText.autoSize = true;
myText.styleSheet = mySS;
myText.html = true;
myText.htmlText = "<p class='hyper'>some text</p>";
How Do I Apply Gravity?
So i finaly figured out how to create opposing force! The problem is when i try to apply gravity my ball completely ignores the opposing force!
Paste this code into the first frame.
Code:
var magnet_radius:Number = 220;
var coefficient:Number = .05;
function distance( dx:Number, dy:Number ) : Number {
return Math.sqrt( dx * dx + dy * dy );
}
function offset( dist:Number ) : Number {
return ( magnet_radius - dist ) * coefficient;
}
function project( dist:Number, dx:Number, dy:Number ) : Object {
var theta:Number = Math.atan2( dy, dx );
var magnitude:Number = offset( dist );
return { x:Math.cos( theta ) * magnitude, y:Math.sin( theta ) * magnitude };
}
function run() : Void {
var dx:Number = _root.magnet._x - ball._x;
var dy:Number = _root.magnet._y - ball._y;
var dist:Number = distance( dx, dy );
if( dist < magnet_radius ) {
var projection:Object = project( dist, dx, dy );
ball._x -= projection.x;
ball._y -= projection.y;
}
}
this.onEnterFrame = run;
I have a Ball object and a Magnet object. I just put them close together and watch the reation.
Id like the ball object to act as though gravity were pushing it down.
Can't Apply Script To MC?
Hey everyone,
I am just starting my first AS 3.0 project and am very frustrated. Many of my techniques include assigning code to individual MCs but, to my understanding, this is not available in 3.0.
For an exaple, I wanted to do a simple blur in and out on a button when I rollOver or rollOut. In the past I would have coded it this way.
button script...
Code:
btnPlay.onRollOver = function(){
imgPlay.playingBackwards = false;
imgPlay.play();
}
btnPlay.onRollOut = function(){
imgPlay.playingBackwards = true;
}
and had this code on my movieclip...
Code:
onClipEvent(enterFrame){
if (playingBackwards) prevFrame();
}
My movieclip just contained a simple tween.
How is this set up in 3.0? I was receiving all sorts of errors that related to on(EnterFrame) events, and as I mentioned earlier, I cannot assign code to a MC.
Ugh. Why change the language!
Apply Css To Different Node
hello..
how do I apply the css to different nodes in the xml data? I have attached the file for you to take a look at. thank you.
How Do I Apply The Same Set Of Commands?
I am sorry if I am overlooking this, but this is hard to search for in the manual. If i want to go to an object, or keyframe, and transform it ...scale it, etc. and change color, or apply a transition... in other words, change more than one thing at a time, and I need to do this to a number of objects, can I record this (like in photoshop) and do the same changes again and again just by using a shortcut?
Cannot Apply Actions
I have a button that whenever I try to apply actions to it, it keeps saying,
"current selection cannot have actions applied to it." I have tried
applying actions to the button by double clicking on the button as well as
the movie stage. Either way I get the above message.
Any ideas what might be causing this message on a button?
--
Brandon
How Can I Apply Gradient...
I have a rectangular shape movie Clip (Size :130px X40 px). I want to apply linear gradient on it using action script. Can anybody help me how can I apply gradient on it.
Note: This movie clip is made manually. Not by using createEmptyMovieClip method.
Can't Apply The Logic?
hi all-
i have been working on a project for quite some time. and have been running into many problem... i have left previous threads, but still need more help. can someone please help me?
this is the links to my previous forum:
http://www.kirupaforum.com/forums/sh...357#post401357
i really appreciate all the help that i can get. can someone please just tell me what my issue might be so that i may look in the right direction. all i need is a little guidance.
-a8le
How To Apply Mask On Txt
hello,
i like to know how to apply a mask on txt when the "use device fonts" is selected.
I use to select " use device fonts " for a better display of the txt, so I can use little font(9 , 10) , and it still readable.
but than if I use the mask, my txt dissappear.
any idea how to solve this???
tanks
How Can I Apply This Effect
hey guys how can I apply the attached effect on a regular image, like without any clicking like image loads and it plays that effect. I want to be able to use this in my currene project that I am working on,
please anyone
thank you
How To Apply Maths
Hello there. Does someone knows a good tutorial or website that shows you how to use maths in flash starting from basics?
I will explain myself better: when i see codes with maths i go thru it and i understand why it work but when i want to start a math code by myself i cant figure out, i always need an example to start from.
Its not too important because when im on those situation i do a diagram of it with simple shapes and i put the numbers and that, but this method takes time
I hope that someone knows a good site about it
How To Apply Actions To This?
This is the code and my question is, where and HOW do i write my actions? My submenu sections is some external swf's called sub1.swf, sub2.swf, sub3.swf etc.
Cascading Menu v1.0
Simon Coulton (s_coulton@hotmail.com) - 8/5/2006
// Functions ------------------------------------------------------------------------
_global.$tweenManager.broadcastEvents = true;
// Main menu
function createMainMenu() {
var a = 1;
var total = mm_array.length;
while (a<=total) {
ypos = ((a-1)*homm)+1;
attachMovie("mainnav_mc", "mainnav"+a+"_mc", this.getNextHighestDepth()+100, {_x:0, _y:ypos});// attach the movieClip
var nc = this["mainnav"+a+"_mc"];
nc.menutext = mm_array[(a-1)];// set the title text for each button
nc.itemnum = a;// set the menu #
a++;
}
}
function moveMenu(num) {
if ((_root.collapsed == true) || (_root.selectedmenu != num)) {
var array = "sm"+num+"_array";
var totalsm = eval(array).length;
var totalmm = mm_array.length;
var a = 1;
while (a<=totalmm) {
mc = this["mainnav"+a+"_mc"];
if (a>num) {
var ypos = (((a-1)*homm)+1)+totalsm*(hosm+1);
mc.tween("_y", ypos, 0.5, "easeOutBack");
} else {
var ypos = ((a-1)*homm)+1;
if (a == num) {
nypos = ypos;
mc.tween("_y", ypos, 0.5, "easeOutBack", 0, onEnd(num, nypos));
} else {
mc.tween("_y", ypos, 0.5, "easeOutBack");
}
}
a++;
}
_root.collapsed = false;
} else {
contractMenu()
_root.collapsed = true;
}
}
function onEnd(num, nypos) {
_root.num = num;
createSubMenu(num, nypos);
}
function contractMenu() {
var c = 1;
while (c<=submenu_array.length) {
removeMovieClip("subnav"+c+"_mc");
removeMovieClip("mask"+c+"_mc");
c++;
}
var g = 1;
while (g<=mm_array.length) {
ypos = ((g-1)*homm)+1;
this["mainnav"+g+"_mc"].tween("_y", ypos, 0.5, "easeOutBack");
g++;
}
}
function createSubMenu(num, nypos) {
var array = "sm"+num+"_array";
var totalsm = eval(array).length;
var ypos = nypos+4;
var c = 1;
while (c<=submenu_array.length) {
removeMovieClip("subnav"+c+"_mc");
removeMovieClip("mask"+c+"_mc");
c++;
}
submenu_array = [];
var a = 1;
while (a<=totalsm) {
ypos = ypos+hosm+1;
attachMovie("subnav_mc", "subnav"+a+"_mc", a+30, {_x:0, _y:ypos});
if (num != mm_array.length) {
attachMovie("mask_mc", "mask"+a+"_mc", a+990, {_x:0, _y:0});
mask_mc = this["mask"+a+"_mc"];
mask_mc._alpha = 10;
mask_mc.onEnterFrame = function() {
this._height = _parent.container_mc["mainnav"+mm_array.length+"_mc"]._y;
};
this["subnav"+a+"_mc"].setMask(mask_mc);
}
nc = this["subnav"+a+"_mc"];
nc._alpha = 0;
nc.itemnum = a;
nc.menutext = eval(array)[(a-1)];
nc.alphaTo(100, 2);
nc.onRelease = function() {
// Function to get submenu actions needs to go here
var my_str:String = new String(this);
_root.select = "You have selected "+my_str.slice(18);
};
submenu_array.push("subnav"+a+"_mc");
a++;
}
}
// Build Menu -----------------------------------------------------------------------
_root.collapsed = true;
createMainMenu();
Can We Apply SetMask() With This?
I'm trying to apply a mask while loading my xml file but I can't make the mask working from right to left side.
Does anyone know how to apply a mask?
Here's my code:
var lexml = new XML();
var chemin = "../xml/";
var tab_images = new Array();
lexml.ignoreWhite = true;
lexml.onLoad = loaderXML;
lexml.load(chemin+"company2.xml");
// Permet de loader le fichier xml
function loaderXML(loaded) {
var racine = this.firstChild;
var nb_elements = racine.childNodes.length;
if (loaded) {
for(i=0;i<nb_elements;i++) {
var company_name = racine.childNodes[i].attributes;
var item = _root.attachMovie("company", "item"+i, i);
item.nom_txt.text = company_name.id;
item.nom_txt.autoSize = "center";
// Positionning space
var cote_gauche = _root["item"+(i-1)].nom_txt._x;
var profondeur_mc = _root["item"+(i-1)].nom_txt._width;
//trace("Item "+left_space+ " Width " +mc_width);
item.nom_txt._x = 0;
item.nom_txt._x = cote_gauche + profondeur_mc + 20;
item.nom_txt._y = 20;
//trace(item);
item.setMask(affecter_mask());
}
} else {
text_area.text = "Can NOT load the images request. Please make sure you have right path...";
}
}
function affecter_mask() {
var mask = _root.attachMovie("mask_area_mc","mask", this.getNextHighestDepth());
mask.onEnterFrame = function() {
this._x += 20;
};
}
Why Do I Delegate When I Can Apply?
What is the advantage of using a Delegate class in as2? I realize that it's old news for as3 guys. But Ive got a medium sized as2 project and Im going through my code and wondering why Im using Delegate.create sometimes. What's wrong with "apply"?
I admit that I must have jumped on the Delegate bandwagon without thinking anything more than "dhuu...thats what the pros must be using".
Am I right in saying that there is nothing at all wrong with simply saying "function_name.apply( this, args )"? Or am I missing something? Is it a matter of memory management? I've done a lot of research on delegation and read all kinds of blogs and scripts from little tweeks to the official.. to >200 lines. Yikes! At the end of the day I wrote my own little delegate class that worked for me (just a rewrite of Proxy without loops). But now that I go though my code I see that I might as well have just used apply because that's all Im doing with it!
Id like to be a better programmer. What am I missing and why shouldn't I do a find and replace here. Why is it better to wrap up "apply"? Will I be better readied to learn other languages? If thats it Im all for it. Could you tell me why?
I just don't understand why I was so convinced that I needed the delegate class when I had "apply" out of the box.
Thanks and I hope I didnt take up too much space here.
Function.apply()
Can somebody please detail for me what the first parameter in Function.apply() is used for? Whenever I try to use the method I get a stack overflow error and I'm not sure why I'm using it incorrectly. My code is fairly huge but I will explain it in a following post if this isn't a common error or there's a simple fix that I've overlooked.
Thanks
Function Apply
I ran into a problem with apply. I've always used delegate and delegate plus, and havent had to deal with apply directly.
The problem is when i try to add parameters to the function.
Code:
// adding one function to the que, with random parameters as an array
_aQueue.push({func:initMask, args:[_mcSummary]}, {func:tweenAll, args:["2", "3", "432"]});
trace(typeof(_aQueue[0].args)) // outputs ARRAY
trace(_aQueue[0].args) // outputs content of array
// apply the function
_aQueue[0].func.apply(this, _aQueue[4].args);
function initMask(whatever:Array):Void {
trace(whatever) // outputs the FIRST element that was in the array
trace(typeof(whatever)) outputs STRING if the first element is a string, outputs mc if the first element is an mc
}
Why do the parameter get ****ed up? I've checked the docs, and as far as i understod its supposed to be an ARRAY of parameters.
Any help appreciated!
Apply To All Buttons ?
[actions script 2.0]
Hi I am writing this code on a bunch of buttons and was wondering if there was a way I could apply some sort of generic thing like move the button 2spaces away. ? Instead of defining exactly where they go on x and y.
Thanks in advance. Charmed
mc4.onRollOver = function(){
var myTweenX:Tween = new Tween(mc3,"_x",Strong.easeOut,mc3._x,939,.2,true);
var myTweenY:Tween = new Tween(mc3,"_y",Bounce.easeOut,mc3._y,176,.2,true);
var myTweenX:Tween = new Tween(mc5,"_x",Bounce.easeOut,mc5._x,920,.2,true);
var myTweenY:Tween = new Tween(mc5,"_y",Strong.easeOut,mc5._y,244,.2,true);
};
mc4.onRollOut = function(){
var myTweenX:Tween = new Tween(mc3,"_x",Strong.easeOut,mc3._x,935.3,.2,true );
var myTweenY:Tween = new Tween(mc3,"_y",Bounce.easeOut,mc3._y,183.9,.2,true );
var myTweenX:Tween = new Tween(mc5,"_x",Bounce.easeOut,mc5._x,929.8,.2,true );
var myTweenY:Tween = new Tween(mc5,"_y",Strong.easeOut,mc5._y,234.8,.2,true );
};
Apply Gradient To Box
I need to apply a gradient and I read this article about making a custom MXML component to accomplish this. It seemed pretty straight forward but I haven't been able to get the gradient to appear.
I guess the only wrinkle is that I wanted to assign a bindable var to it so that I can easily change the values based on what button a user clicks on. I've tried sticking hard values in and it still won't render.
Here's my code:
My app's main.mxml
Code:
//In a script node:
[Bindable] public var beginGradient:uint;
[Bindable] public var endGradient:uint;
private function loadLayout(index:int):void
{this.beginGradient = moduleXML.moduleItem[index].attribute("beginGradient");
this.endGradient = moduleXML.moduleItem[index].attribute("endGradient");
}
<local:GradientBox id="hbox" gradientFrom="{beginGradient}" gradientTo="{endGradient}" width="650" horizontalGap="0" height="330" styleName="insetBox" clipContent="true" cornerRadius="10" backgroundColor="#F2EBE8" borderThickness="1" borderColor="#BBBBBB" x="5" y="5" borderStyle="solid">
GradientBox.mxml
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Boxxmlns:mx="http://www.adobe.com/2006/mxml"
borderStyle="solid"
borderThickness="0">
<mx:Script>
<![CDATA[
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import mx.core.EdgeMetrics;
import mx.utils.ColorUtil;
import mx.utils.GraphicsUtil;
public var _gradientFrom:uint;
public var _gradientTo:uint;
public function set gradientFrom(value:uint):void
{
this._gradientFrom = value;
}
public function set gradientTo(value:uint):void
{
this._gradientTo = value;
}
// ------------------------------------------------------------------------------------- //
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
trace("update called!");
super.updateDisplayList(unscaledWidth, unscaledHeight);
var g:Graphics = graphics;
var b:EdgeMetrics = borderMetrics;
var w:Number = unscaledWidth - b.left - b.right;
var h:Number = unscaledHeight - b.top - b.bottom;
var m:Matrix = verticalGradientMatrix(0, 0, w, h);
g.clear();
g.beginGradientFill("linear", [_gradientFrom, _gradientTo], [1, 1], [0, 255], m);
var cn:uint = this.getStyle("cornerRadius");
GraphicsUtil.drawRoundRectComplex(g, b.left, b.top, w, h, cn, cn, cn, cn);
g.endFill();
}
]]>
</mx:Script>
</mx:Box>
Can't Apply The Logic?
hi all-
i have been working on a project for quite some time. and have been running into many problem... i have left previous threads, but still need more help. can someone please help me?
this is the links to my previous forum:
http://www.kirupaforum.com/forums/sh...357#post401357
i really appreciate all the help that i can get. can someone please just tell me what my issue might be so that i may look in the right direction. all i need is a little guidance.
-a8le
How To Apply Mask On Txt
hello,
i like to know how to apply a mask on txt when the "use device fonts" is selected.
I use to select " use device fonts " for a better display of the txt, so I can use little font(9 , 10) , and it still readable.
but than if I use the mask, my txt dissappear.
any idea how to solve this???
tanks
Can't Apply Actions?
Hello, I have a flash header with several buttons that I have added the geturl action to. But I'm having problems with these three buttons that won't let me add an action script to them. Ok I'll try to explain this in the best possible way:
I have a button clip named "login button clip" and it has three sections:
'actions for frame 1'
'actions for frame 10'
'actions for button area 8'
But for some reason 'button area 8' will not let me add ANY type of action to it, it gives me the following error:
Code:
Current selection can not have actions applied to it
Is there a way to unlock this button area or something? (sorry but i'm kind of new to flash)
Apply Stylesheet
Can anyone help me apply stylesheets to this XML? How do I load my external css-file in flash and how do I write in my XML file to set the styles?
Code in Flash:
Code:
//loading pics and text:
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes[i].attributes.title);
pArray.push(gallery.childNodes[i].attributes.source);
}
containerMC.loadPic(0);
} else {
title_txt.text = "Error!";
}
}
gallery_xml.load("main"+main+"/sub"+sub+"/gallery.xml");
My XML file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<portfolio info ="GREGORY">
<image title="Some text here" source="main1/sub1/pic1.jpg"/>
<image title="" source="main1/sub1/pic2.jpg"/>
<image title="" source="main1/sub1/pic3.jpg"/>
<image title="" source="main1/sub1/pic4.jpg"/>
<image title="" source="main1/sub1/pic5.jpg"/>
<image title="" source="main1/sub1/pic6.jpg"/>
</portfolio>
How Do You Apply And Array?
Here is the code:
Code:
var magnet_radius:Number = 130;
var coefficient:Number = .10;
var GRAVITY:Number = Math.random(.1);
var ball:MovieClip = returnBall();
this.onEnterFrame = run;
function distance( dx:Number, dy:Number ) : Number {
return Math.sqrt( dx * dx + dy * dy );
}
function offset( dist:Number ) : Number {
return ( magnet_radius - dist ) * coefficient;
}
function project( dist:Number, dx:Number, dy:Number ) : Object {
var theta:Number = Math.atan2( dy, dx );
var magnitude:Number = offset( dist );
return { x:Math.cos( theta ) * magnitude, y:Math.sin( theta ) * magnitude };
}
ball.vy = 0;
function run() : Void {
var forceX:Number = 0;
var forceY:Number = GRAVITY;
var dx:Number = magnet._x - ball._x;
var dy:Number = magnet._y - ball._y;
var dist:Number = distance( dx, dy );
if( dist < magnet_radius ) {
var projection:Object = project( dist, dx, dy );
forceX -= projection.x;
forceY -= projection.y;
}
ball.vx += forceX;
ball.vy += forceY;
ball._x += ball.vx;
ball._y += ball.vy;
}
function returnBall() : MovieClip {
return ball;
}
There is a single ball and a single magnet. Id like there to be a ball1, ball2, ball3 and a magnet1 magnet2 magnet3. Id like the code to apply to all of them
Any way to do this easily?
WHY CANT I APPLY AS TO A MC USING DEVICE FONTS?
why can i apply an action or a tween to a MC that contains text which select use device font...
i want the text to look clear like that, but i want to apply AS to the MC....
is this possible... i know ive seen some sites with crisp clean texts... how do they do it..
are they gifs... because you can make pictures of text and look clearer than they do when you type them in..
thanks for the help,
mannyme80
Help With Setselection Needed Apply Within
Basicaly I have an input multine line text box which I wish the user to add a list of words to however after each word is entered - i wish them to press 'enter' to first add their word to a scrolling list box and to then move the cursor to the next line in the input box for them to carry on entering more.
I've got this to work however on the first time you enter text into box you have to press return twice to move cursor on - which in turn causes the scolling box to be full of the same word on the first line of text box (_root.menu01.display)only changing the first word takes effect.
Basically I need help for the cursor to move on the first instance of adding a word because subsequent ones the cursor works fine.
This is the code on a button which detects when enter is pressed _root.menu01.display - is my input box embedded within a mc
on (keyPress "<Enter>") {
_root.menu01.display += newline;
words = new Array();
var names = _root.menu01.display.split("
");
for (var i=0;i<names.length;i++){
words[i] = names[i]; //thats really words(i)
//and names(i) square brackets arent coming up on this post
}
//load words into scroll box
call ("/MyComboBox:Initialise");
for (var j=0; j<words.length;j++){
/:pupil = words[j];
tellTarget ("/") {
MyCombobox2/MyListBox2:NewPerson = /:pupil;
call ("MyCombobox2/MyListBox2:AddItem");
call ("MyCombobox2/MyListBox2:Refresh");
NewPerson = " ";}
}
//move cursor on
Selection.setFocus("_root.menu01.display");
Selection.setSelection(_root.menu01.display.length , _root.menu01.display.length);
stop();
}
[Edited by ceeacs on 01-24-2002 at 06:30 AM]
How Do I Apply An Action To A Layer...?
Hi All,
How do i apply an action to an image in a layer?? I want to be able to make an image visible for a few seconds and then invisible, but on a random time...not just a loop on/off type thing.
I need the script that will enable an image that comes visible then invisible randomly.
So the image is turning on/off in different time intervals.
Is this asking way too much for someone only a week old in flash ?
Cheers lads,
dvdvault
Dynamically Apply A Textformat?
Does anyone know how to dynamically apply a textformat to some dynamically generated text? I have been struggling with this for far too long...
Something in the line of
eval("headline" + i + ".setTextFormat(myformat)");
although this doesn't work! Neither does
eval("headline2.setTextFormat(myformat)");
but
eval(headline.setTextFormat(myformat));
does work, although it's not dynamic. Argh!
Any help would be very much appeciated!
24fps. Does This Apply To All Formats?
i have a movie at 24fps when i export it as a swf and transfer the file from my mac to PC, the PC it plays it at 12fps and my mac plays it at 24. Anyone know why this is happening??
Thanks if you do.
How To Apply Gravity To An Angle
this was in one of the experiments on bit-101...
how do you apply gravity to an angle?
i can do the gravity thing, and make it bounce off rectangles, but i dont know how to make it bounce off something with an angle
can anyone help?
Apply Function To Keep MC On Screen
I have some simple code to keep my mc's on the screen.
function onScreen (){
if (_x>450) {
_x = 450;
}
if (_x<0) {
_x = 0;
}
}
I want to put it in a function on each of my moving mc's. I tried this:
onClipEvent (enterFrame) {
onScreen()
}
but this doesn't work? Any help? thx.
PHP Nuke FLASH APPLY
Hello,
I was trying to add a flash effect to the header of my Nuke theme but it couldnt work.
what i did is i copied the script of the flash which is the entire thing between <OBJECT> </OBJECT> including the object word but it just shws me a white sqaure instread of the flash.
any support would be appreiated ..
thanks
|