senocular
|
Last Activity: 04-09-2013 06:05 PM
- User Lists
Visitor Messages
Showing Visitor Messages 1 to 10 of 12
-
03-02-2009 06:07 PMtdunlopHey Senocular!
I have a scrollbox that loads a text file (resume.txt) into a dynamic text field. this way the client can change her resume and load it herself. All good.
But I want to style the resume with bold, font and justifcation attributes once before loading it into the textfield. How would you do this?
Would you add html tags to the resume.txt doc, THEN pass that to a CSS StyleSheet to parse and THEN load that into the loader attached to the scrollbox's textfield?
What do you think?
Thanks TD -
02-27-2009 11:47 PMcsmallerHey Senocular
first off, thanks for the the great Transform Tool. I have a question about the resize of the loader.content
basically when the transform tool resizes the movieClip the loader.content in the movie clip doesn't resize. so when I try to size the loader.content to the dimensions of the transformed movieClip it sizes completely wrong. too wide or too thin, too tall or too short. Really no rhyme or reason to it. Was hoping maybe you knew why this was. I've tried everything.
I put a sample 300 pixel width bar on the screen and resized the movieClip to 300 and when i apply the resize to the loader.content it makes it about 250 pixels wide while its container stays at 300. very weird.
Thanks for your help! -
02-09-2009 10:48 PMtdunlopHey
a response of yours in this forum gave me the removeChild conditional I needed:
if (obj.parent) obj.parent.removeChild(obj);
good lookin' out!
Thanks
TD -
01-10-2009 10:05 PMBlade27Hi, Im struggling to retrieve my xml as text in a dynamic text field. I've successfully loaded my images. When you rollover them, an image description displays in a dynamic textfield. What I would like is for another text message to display after the image is clicked. The second text message is I want to display is the xml attribute "detail". Below is my xml and code:
ActionScript Code:
<gallery >
<img thumb="images/Sunset.jpg" detail="sun" >Sun is beautiful!</img>
<img thumb="images/Winter.jpg" detail="Winter"> Winter is beautiful!</img>
<img thumb="images/Waterlilies.jpg" detail="Waterlillies"> Waterlillies are beautiful</img>
<img thumb="images/forest.jpg" detail="Forest">Forest is beautiful!</img>
<img thumb="images/Tree.jpg" detail="Tree">Tree is beautiful!</img>
</gallery>
Actionscript:
ActionScript Code:
stop();
import fl.transitions.easing.*;
import gs.TweenLite;
var centerX:Number = (stage.stageWidth / 2)- 100;
var centerY:Number = (stage.stageHeight / 2)- 180;
var radiusX:Number = 150;
var radiusY:Number = 20;
var speed:Number = 0;
var minSpeed:Number = -0.1;
var maxSpeed:Number = 0.1;
var rangeSpeed:Number = maxSpeed - minSpeed;
var itemArray:Array = new Array();
var canvas:MovieClip = new MovieClip();
var minY:Number = centerY - radiusY;
var maxY:Number = centerY + radiusY;
var rangeY:Number = maxY - minY;
var minScale:Number = 0.5;
var maxScale:Number = 1.2;
var rangeScale:Number = maxScale - minScale;
addChild(canvas);
TweenLite.from(canvas, 1, {y:"-250",alpha:0, delay: 1/2});
var toolTip:MovieClip = new Tooltip();
addChild(toolTip);
//xml
var imageLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader: URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("images.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(event:Event):void {
xml = XML(event.target.data);
xmlList = xml.children();
//trace(xml.img.@detail);
//target_mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
for(var i:int = 0; i <xmlList.length(); i++)
{
vote_mc.visible = false;
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
imageLoader.name = xmlList[i].attribute("thumb");
imageLoader.detail = xmlList[i].@detail;
//trace(xmlList[i].@detail);
var target_mc:MovieClip = new Target_mc();
canvas.addChild(target_mc);
TweenLite.from(target_mc, 1, {x:"-100",rotation:90, delay: i / 4});
itemArray.push(target_mc);
itemArray[i].buttonMode = true;
itemArray[i].addEventListener(MouseEvent.CLICK, showVote);
itemArray[i].addEventListener(MouseEvent.MOUSE_OVER,lightUp );
itemArray[i].addEventListener(MouseEvent.MOUSE_OUT,lightOff );
//target_mc.x =100 ;
//target_mc.y = centerY;
target_mc.addChild(imageLoader);
target_mc.scaleX = target_mc.scaleY = .5;
target_mc.alpha = .9
target_mc.itemAngle = Math.PI * 2 / xmlList.length() * i;
//but.addEventListener(MouseEvent.CLICK, onClick);
target_mc.addEventListener(Event.ENTER_FRAME, animate);
target_mc.addEventListener(MouseEvent.MOUSE_MOVE,f ollow);
}
}
function animate(e:Event):void
{ speed = mouseX / stage.stageWidth * rangeSpeed + minSpeed;
e.currentTarget.x = Math.cos(e.currentTarget.itemAngle) * radiusX + centerX;
e.currentTarget.y = Math.sin(e.currentTarget.itemAngle) * radiusY + centerY;
e.currentTarget.itemAngle += speed;
itemArray.sortOn("y");
for(var i:Number = 0; i < xmlList.length(); i++)
{
canvas.setChildIndex(itemArray[i], i);
var pct:Number = (itemArray[i].y - minY) / rangeY;
var scale:Number = pct * rangeScale + minScale;
itemArray[i].scaleX = itemArray[i].scaleY = scale;
}
}
function lightUp(evt:MouseEvent):void{
evt.currentTarget.alpha = 1;
for(var k:int = 0; k < xmlList.length();k++){
if (xmlList[k].attribute("thumb") == evt.target.name){
info.text = xmlList[k];
}
}
toolTip.gotoAndPlay(2);
}
function lightOff(evt:MouseEvent):void{
evt.currentTarget.alpha = .9;
toolTip.gotoAndStop(1);
}
function follow(evt:MouseEvent) {
toolTip.x = mouseX;
toolTip.y = mouseY;
}
function showVote(evt:MouseEvent) {
vote_mc.visible = true;
TweenLite.from(vote_mc, 1, {x:"0",alpha:0, delay: 1/5});
canvas.visible = false;
for(var k:int = 0; k < xmlList.length();k++){
if (xmlList[k].attribute("detail") == evt.target.name){
test.text = xmlList[k]; -
11-18-2008 01:37 AMchongelaineHi Senocular,
I had been using your transform tool for AS3. It work perfectly, until I need to find away to set the registration to center.
I tried by getting the original x and y then add the mc width/2 and mc height/2 accordingly. It works well as long as I didnt mirror the mc. Is there any way to do it professionally? or any better way you recommended?
Please clue me. Thank you. -
10-30-2008 02:58 PMsaravananHi Senocular,
One more usage of the SWFReader class
http://www.designscripting.com/2008/...r-application/
Thanks again for the class file -
10-06-2008 09:40 PMInline853hey senocular,
I was using your tutorial from Kirupa about how to create a dynamic drop down menu with xml. I ran into a snag when I tried to put 1 dynamic menu into another. Its kind of hard to explain, but heres my post where I explain it better. If you could give any advice on how to make two menus work together, that would be nice. Thanks =)
http://www.actionscript.org/forums/s...9&postcount=12 -
08-19-2008 02:36 PMnite21hi friend senocular will u help me out in a mute btn it is not working
http://www.actionscript.org/forums/s....php3?t=180364
here is the post
thanks
About Me
- About senocular
- Biography
- Graduated from college with Imaging And Digital Arts degree at UMBC with high interests in interface design and human-computer interaction.
- Location
- San Francisco, CA (USA)
- Interests
- Anything outdoors is nice though I dont get out often enough. Working in Flash etc is also quite fun if I do say so myself
- Occupation
- Adobe
- Signature
Contact Info
- Home Page
- http://www.senocular.com
- This Page
- http://www.actionscript.org/forums/member.php3?u=8886




