Using attrValues of flake overlays while importing nixpkgs results in `error: attribute 'autoslot' missing' - nix

As in the title; when I use attrValues overlays, such as in the following example:
{
description = "Shared settings for our packages!";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
flake-utils.url = github:numtide/flake-utils;
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = inputs#{ self, nixpkgs, flake-utils, ... }: with builtins; with flake-utils.lib; let
lib = import ./package.nix nixpkgs;
overlays = with lib; rec {
overlays = let
lib-overlay = import ./overlay.nix nixpkgs;
in j.foldToSet' [
{
lib = lib-overlay;
default = lib-overlay;
}
(j.imports.overlaySet {
dir = ./callPackages/python2;
func = file: final: prev: j.update.python.callPython.two final prev file;
})
(j.imports.overlaySet {
dir = ./callPackages/python3;
func = file: final: prev: j.update.python.callPython.three final prev file;
})
(j.imports.set { dir = ./overlays; recursive = true; ignores.dirs = true; })
(j.imports.overlaySet { dir = ./callPackages; call = 1; })
];
overlay = overlays.default;
defaultOverlay = overlay;
};
make = system: with lib; rec {
# This does not work
legacyPackages = import nixpkgs { inherit system; overlays = attrValues overlays.overlays; };
# This works
legacyPackages = import nixpkgs { inherit system; overlays = with overlays.overlays; [ overlays.overlays.lib Python autoslot ]; };
# Traced here
packages = flattenTree (let _ = j.filters.has.attrs legacyPackages (unique (flatten [
(subtractLists (attrNames nixpkgs.legacyPackages.${system}) (attrNames legacyPackages))
(attrNames overlays.overlays)
])); in trace (attrNames legacyPackages.Python.pkgs.autoslot) _);
package = packages.default;
defaultPackage = package;
apps.default = settings.make.app package;
app = apps.default;
defaultApp = app;
devShells.default = import ./devShell.nix system self;
devShell = devShells.default;
defaultdevShell = devShell;
};
in (eachSystem allSystems make) // overlays // { inherit lib; };
}
Specifying overlays manually works, while attrValues overlays.overlays does not, giving me the error error: attribute 'autoslot' missing.

The reason for this were the Python Packages not updating with each new overlay; solved by Jan Tojnar's reply here:
overlays =
let
emptyOverlay = final: prev: {};
in
{
autoslot = final: prev: {
python310 = prev.python310.override (prevArgs: {
packageOverrides =
let
ourOverlay = new: old: {
autoslot = new.callPackage ./autoslot.nix {};
};
in
prev.lib.composeExtensions
prevArgs.packageOverrides or emptyOverlay
ourOverlay;
});
};
backtrace = final: prev: {
python310 = prev.python310.override (prevArgs: {
packageOverrides =
let
ourOverlay = new: old: {
backtrace = new.callPackage ./backtrace.nix {};
};
in
prev.lib.composeExtensions
prevArgs.packageOverrides or emptyOverlay
ourOverlay;
});
};
}

Related

How to pass nixpkgs.config.allowUnfree to local nixpkgs repository

I want to use hubstaff package from local nixpkgs repository,
let
# pass config so that packages use correct allowUnfree for example
nixpkgs-local = import /home/bjorn/projects/nixpkgs { inherit config; };
in
rec {
config.allowUnfree = true;
config.packageOverrides = old: {
# packages from local nixpkgs
inherit (nixpkgs-local) safeeyes hubstaff;
....
but its unfree package, so throws unfree package error
$ sudo nixos-rebuild dry-build
building the system configuration...
error: Package ‘hubstaff-1.3.1-ff75f26’ in /home/bjorn/projects/nixpkgs/pkgs/applications/misc/hubstaff/default.nix:60 has an unfree license (‘unfree’), refusing to evaluate.
As I understand I need to pass nixpkgs.config.allowUnfree = true, but import /home/bjorn/projects/nixpkgs { inherit config; }; above is not working
P.S.
other issue I have is that I have tried to peek what value I am passing in config.nixpkgs.allowUnfree here
{ config, pkgs, lib, ... }:
let r = {
imports = [
./hardware-configuration.nix
./hardware-configuration-override.nix
./hardware-programs.nix
/home/bjorn/projects/nixpkgs/nixos/modules/services/misc/safeeyes.nix
];
....
};
in
builtins.seq (lib.debug.showVal config.nixpkgs.allowUnfree) r
but I get infinite recursion error, maybe someone knows the way to do this?
To answer your second "P.S." question, here's the reason why and suggestions what to do instead.
The infinite recursion occurs because the module system needs to evaluate the 'root' of every module and some attributes like imports in order to build the term that represents the root of config.
With your call to seq you're evaluating an attribute of config at a point where config itself is still being evaluated.
Technically, you can solve this by adding your seq call to an attribute instead of around the entire module. This way, config can be evaluated without evaluating your seq call.
Probably an easier way to have a look at your configuration is to import it in nix repl
nix-repl> c = import <nixpkgs/nixos> { configuration = ./nixos/root/default.nix; /* or the file usually called configuration.nix */ }
nix-repl> c.config.nixpkgs.config.allowUnfree
true
You can use the :r command to reload all files when iterating. Nix likes to cache them because the implementation is geared toward batch execution.
Tnx to tilpner
I was passing wrong config
Namely,
this is config that import /home/bjorn/projects/nixpkgs was expecting
nix-repl> c = import <nixpkgs/nixos> {}
nix-repl> c.config.nixpkgs
{ config = { ... }; overlays = [ ... ]; pkgs = { ... }; system = "x86_64-linux"; }
This is what I was passing
nix-repl> c.config
{ _module = { ... }; assertions = [ ... ]; boot = { ... }; config = { ... }; containers = { ... }; dysnomia = { ... }; ec2 = { ... }; environment = { ... }; fileSystems = { ... }; fonts = { ... }; gnu = false; hardware = { ... }; i18n = { ... }; ids = { ... }; jobs = «error: The option `jobs' is used but not defined.»; kde = { ... }; krb5 = { ... }; lib = { ... }; meta = { ... }; nesting = { ... }; networking = { ... }; nix = { ... }; nixpkgs = { ... }; passthru = «error: The option `passthru' is used but not defined.»; power = { ... }; powerManagement = { ... }; programs = { ... }; security = { ... }; services = { ... }; sound = { ... }; swapDevices = [ ... ]; system = {
Its the one that passed to /etc/nixos/configuration.nix
Fix:
{ config, pkgs }:
let
# pass config so that packages use correct allowUnfree for example
unfreeConfig = config.nixpkgs.config // {
allowUnfree = true;
};
nixpkgs-local = import /home/bjorn/projects/nixpkgs { config = unfreeConfig; };
in

How to override 2 (two) packages in Nixos configuration.nix

I have some package to override in my configuration.nix. So I write the code as follows:
nixpkgs.config = {
allowUnfree = true;
packageOverrides = {
pkgs: rec {
#mumble + pulse audio
mumble = pkgs.mumble.override {
pulseSupport = true;
};
#kernel for intel ethernet and Testing e1000e package override
linuxPackages.e1000e = pkgs.linuxPackages.e1000e.overrideDerivation (attrs: {
name = "e1000e-3.3.3-${config.boot.kernelPackages.kernel.version}";
src = fetchurl {
url = "https://www.dropbox.com/s/pxx883hx9763ygn/e1000e-3.3.3.tar.gz?dl=0";
sha256 = "1s2w54927fsxg0f037h31g3qkajgn5jd0x3yi1chxsyckrcr0x80";
};
});
};
};
};
but when I do nixos-rebuild switch, I got the following error:
syntax error, unexpected ':', expecting '.' or '=', at 37,11
which is at pkgs: rec {...
What did I do wrong? At first I write it by separating the pkgs like this:
packageOverrides = {
pkgs: with pkgs: {......}; #this is for mumble
pkgs: rec {...}; #this is for kernel
};
and still got the same error.
The proper solution is:
nixpkgs.config = {
allowUnfree = true;
packageOverrides = super: let self = super.pkgs; in {
mumble = super.mumble.override { pulseSupport = true; };
linuxPackages = super.linuxPackages // {
e1000e = super.linuxPackages.e1000e.overrideDerivation (old: {
name = "e1000e-3.3.3-${config.boot.kernelPackages.kernel.version}";
src = fetchurl {
url = "https://www.dropbox.com/s/pxx883hx9763ygn/e1000e-3.3.3.tar.gz?dl=0";
sha256 = "1s2w54927fsxg0f037h31g3qkajgn5jd0x3yi1chxsyckrcr0x80";
};
});
};
};
}
The variable super refers to the Nixpkgs set before the overrides are applied and self refers to it after the overrides are applied. It's important to distinguish these two explicitly to avoid infinite recursions, etc.
Also, note that your override
linuxPackages.e1000e = pkgs.linuxPackages.e1000e.overrideDerivation ...
replaces the linuxPackages attribute set with one that contains nothing but the (overriden) e1000e derivation. That's probably not what you want.

Change colors in devexpress charts

I am drawing a pie chart using Devexpress in my MVC project.
While doing it by default my chart generated with three colors, as below
but my client is not satisfied, with the colors of it and wanted me to change them which match with our application background, so please help me, how to do this.
Thanks in advance.
Here is my code.
settings.Name = "chart";
settings.Width = 600;
settings.Height = 250;
settings.BorderOptions.Visible = false;
Series series1 = new Series("Type", DevExpress.XtraCharts.ViewType.Pie3D);
settings.Series.Add(series1);
series1.ArgumentScaleType = ScaleType.Qualitative;
series1.ArgumentDataMember = "ClassName";
series1.ValueScaleType = ScaleType.Numerical;
series1.ValueDataMembers.AddRange(new string[] { "PercentageValues" });
series1.LegendPointOptions.PointView = PointView.ArgumentAndValues;
series1.LegendPointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
series1.LegendPointOptions.ValueNumericOptions.Precision = 0;
series1.Label.ResolveOverlappingMode = ResolveOverlappingMode.Default;
series1.Label.Visible = false;
Please refer the following code. I have successfully implemented the same for giving custom color for rangebar. I guess it will work for your case also
settings.CustomDrawSeriesPoint = (s, ev) =>
{
BarDrawOptions drawOptions = ev.SeriesDrawOptions as BarDrawOptions;
if (drawOptions == null)
return;
Color colorInTarget = Color.Blue;
double x = ev.SeriesPoint.Values[0];
double y = ev.SeriesPoint.Values[1];
if (x == 0)
{ //Do starting
colorInTarget = Color.FromArgb(159,125, 189);
}
else{
//Red - price Increase
// Green price Decrease
if (y > previousYValue)
{
colorInTarget = Color.Red; ;
}
else
{
colorInTarget = Color.Green;
}
}
previousYValue = y;
drawOptions.Color = colorInTarget;
drawOptions.FillStyle.FillMode = FillMode.Solid;
drawOptions.Border.Color = Color.Transparent;
};
you can set the theme and palette properties of the chart control. follow the links below to devexpress documentation. although the examples refers to winform application they are still avaliable in asp.net mvc controls.
http://documentation.devexpress.com/#WindowsForms/CustomDocument7433
http://documentation.devexpress.com/#WindowsForms/CustomDocument5538
// Define the chart's appearance and palette.
barChart.AppearanceName = "Dark";
barChart.PaletteName = "Opulent";
private List<StudentClass.ChartsPointsSummary> GetStudentSummaryResults()
{
var StudentId = Convert.ToInt32(Request.Params["StudentID"]);
var StudentDetailsP = CtxSM.SMISGet_StudentAttendanceDetailsByStudentId(StudentId, SessionDataManager.SessionData.LoginUserId, SessionDataManager.SessionData.AcademicYearID, SessionDataManager.SessionData.BusinessUnitId, ref outError).ToList();
var Presents = StudentDetailsP.Select(p => new { p.Months, p.Presents});
var CountsP = StudentDetailsP.Count();
List<StudentClass.ChartsPointsSummary> MT = new List<StudentClass.ChartsPointsSummary>();
foreach (var ab in Presents)
{
MT.Add(new StudentClass.ChartsPointsSummary { PresentSummaryX = ab.Months, PresentSummaryY = Convert.ToInt32(ab.Presents) });
}
var StudentDetailsA = CtxSM.SMISGet_StudentAttendanceDetailsByStudentId(StudentId, SessionDataManager.SessionData.LoginUserId, SessionDataManager.SessionData.AcademicYearID, SessionDataManager.SessionData.BusinessUnitId, ref outError).ToList();
var Absents = StudentDetailsP.Select(p => new { p.Months, p.Absents });
var CountsA = StudentDetailsA.Count();
foreach (var ab in Absents)
{
MT.Add(new StudentClass.ChartsPointsSummary { AbsentSummaryX = ab.Months, AbsentSummaryY = Convert.ToInt32(ab.Absents) });
}
var StudentDetailsL = CtxSM.SMISGet_StudentAttendanceDetailsByStudentId(StudentId, SessionDataManager.SessionData.LoginUserId, SessionDataManager.SessionData.AcademicYearID, SessionDataManager.SessionData.BusinessUnitId, ref outError).ToList();
var CountL = StudentDetailsL.Count();
var Leaves = StudentDetailsP.Select(p => new { p.Months, p.Leaves });
foreach (var ab in Leaves)
{
MT.Add(new StudentClass.ChartsPointsSummary { LeaveSummaryX = ab.Months, LeaveSummaryY = Convert.ToInt32(ab.Leaves) });
}
return MT;
}
#Html.DevExpress().Chart(settings =>
{
settings.Name = "SummaryDetailsById";
settings.Width = 1032;
settings.Height = 250;
Series chartSeries = new Series("Presents", DevExpress.XtraCharts.ViewType.Bar);
chartSeries.ArgumentDataMember = "PresentSummaryX";
chartSeries.ValueDataMembers[0] = "PresentSummaryY";
settings.Series.Add(chartSeries);
Series chartSeries2 = new Series("Absents", DevExpress.XtraCharts.ViewType.Bar);
chartSeries2.ArgumentDataMember = "AbsentSummaryX";
chartSeries2.ValueDataMembers[0] = "AbsentSummaryY";
settings.Series.Add(chartSeries2);
Series chartSeries3 = new Series("Leaves", DevExpress.XtraCharts.ViewType.Bar);
chartSeries3.ArgumentDataMember = "LeaveSummaryX";
chartSeries3.ValueDataMembers[0] = "LeaveSummaryY";
settings.Series.Add(chartSeries3);
settings.CrosshairEnabled = DefaultBoolean.Default;
settings.BackColor = System.Drawing.Color.Transparent;
settings.BorderOptions.Visibility = DefaultBoolean.True;
settings.Titles.Add(new ChartTitle()
{
Text = "Student Attendance Summary"
});
XYDiagram diagram = ((XYDiagram)settings.Diagram);
diagram.AxisX.Label.Angle = -30;
diagram.AxisY.Interlaced = true;
}).Bind(Model).GetHtml()

OOXML : keep images displayed after moving the header content to to the body

I am using open XML SDK and I want to move the content of content control (containing images) from the header to the body, the problem that images does not show after moving. After copying the content control content I am adding the image parts in this way :
foreach (var headerPart in wordDocument.MainDocumentPart.HeaderParts)
{
SdtBlock sdtToSave = this.FindSdtBlock(contentControlTag, headerPart );
if (sdtToSave != null)
{
foreach (var imagePart in headerPart.ImageParts)
{
ImagePart newPart = mainPart.AddImagePart(imagePart.ContentType);
this.GenerateImagePartContent(newPart, imagePart.GetStream()); }
}
}
private void GenerateImagePartContent(ImagePart imagePart, Stream partStream)
{
imagePart.FeedData(partStream);
partStream.Close();
}
then if I add this lines :
Paragraph paragraph = sdtToSave.SdtContentBlock.GetFirstChild<Paragraph>();
Run run = new Run();
paragraph.Append(run);
run.Append(this.GenerateDrawing(mainPart.GetIdOfPart(newPart)));
private Drawing GenerateDrawing(String relationshipID)
{
Drawing drawing1 = new Drawing();
Inline inline1 = new Inline() { DistanceFromTop = (UInt32Value)0U, DistanceFromBottom = (UInt32Value)0U, DistanceFromLeft = (UInt32Value)0U, DistanceFromRight = (UInt32Value)0U };
Extent extent1 = new Extent() { Cx = 152400L, Cy = 152400L };
EffectExtent effectExtent1 = new EffectExtent() { LeftEdge = 0L, TopEdge = 0L, RightEdge = 0L, BottomEdge = 0L };
DocProperties docProperties1 = new DocProperties() { Id = (UInt32Value)1U, Name = "Image 1" };
NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties1 = new NonVisualGraphicFrameDrawingProperties();
A.GraphicFrameLocks graphicFrameLocks1 = new A.GraphicFrameLocks() { NoChangeAspect = true };
graphicFrameLocks1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
nonVisualGraphicFrameDrawingProperties1.Append(graphicFrameLocks1);
A.Graphic graphic1 = new A.Graphic();
graphic1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
A.GraphicData graphicData1 = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture" };
Pic.Picture picture1 = new Pic.Picture();
picture1.AddNamespaceDeclaration("pic", "http://schemas.openxmlformats.org/drawingml/2006/picture");
Pic.NonVisualPictureProperties nonVisualPictureProperties1 = new Pic.NonVisualPictureProperties();
Pic.NonVisualDrawingProperties nonVisualDrawingProperties1 = new Pic.NonVisualDrawingProperties() { Id = (UInt32Value)0U, Name = "AddTo_Blink.png" };
Pic.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties1 = new Pic.NonVisualPictureDrawingProperties();
nonVisualPictureProperties1.Append(nonVisualDrawingProperties1);
nonVisualPictureProperties1.Append(nonVisualPictureDrawingProperties1);
Pic.BlipFill blipFill1 = new Pic.BlipFill();
A.Blip blip1 = new A.Blip() { Embed = relationshipID };
A.BlipExtensionList blipExtensionList1 = new A.BlipExtensionList();
A.BlipExtension blipExtension1 = new A.BlipExtension() { Uri = "{28A0092B-C50C-407E-A947-70E740481C1C}" };
A14.UseLocalDpi useLocalDpi1 = new A14.UseLocalDpi() { Val = false };
useLocalDpi1.AddNamespaceDeclaration("a14", "http://schemas.microsoft.com/office/drawing/2010/main");
blipExtension1.Append(useLocalDpi1);
blipExtensionList1.Append(blipExtension1);
blip1.Append(blipExtensionList1);
A.Stretch stretch1 = new A.Stretch();
A.FillRectangle fillRectangle1 = new A.FillRectangle();
stretch1.Append(fillRectangle1);
blipFill1.Append(blip1);
blipFill1.Append(stretch1);
Pic.ShapeProperties shapeProperties1 = new Pic.ShapeProperties();
A.Transform2D transform2D1 = new A.Transform2D();
A.Offset offset1 = new A.Offset() { X = 0L, Y = 0L };
A.Extents extents1 = new A.Extents() { Cx = 152400L, Cy = 152400L };
transform2D1.Append(offset1);
transform2D1.Append(extents1);
A.PresetGeometry presetGeometry1 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle };
A.AdjustValueList adjustValueList1 = new A.AdjustValueList();
presetGeometry1.Append(adjustValueList1);
shapeProperties1.Append(transform2D1);
shapeProperties1.Append(presetGeometry1);
picture1.Append(nonVisualPictureProperties1);
picture1.Append(blipFill1);
picture1.Append(shapeProperties1);
graphicData1.Append(picture1);
graphic1.Append(graphicData1);
inline1.Append(extent1);
inline1.Append(effectExtent1);
inline1.Append(docProperties1);
inline1.Append(nonVisualGraphicFrameDrawingProperties1);
inline1.Append(graphic1);
drawing1.Append(inline1);
return drawing1;
}
all images are shown at the end of body.
From the OXML SDK productivity tool I can see that bookmarks are used to insert images inside a paragraph.
To summarize, I want to know how to keep images when moving content controls from header to the body.
Regards.
When you add your image part to the mainPart, it will be given a relId which is unlikely to be the same as the relId it had in the headerPart. So you'll have to adjust the relId in the drawing (Embed = relationshipID) to match.

AS2 TweenLite: tween to frame

I have the following setup loaded:
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
TweenPlugin.activate([FramePlugin]);
OverwriteManager.init(OverwriteManager.AUTO);
and am using the following code to tween an mc to frame 20.
TweenLite.to(circle, 1, {frame:20, ease:Elastic.easeOut});
Problem is nothing happens, circle is a variable containing my mc and traces fine.
Output of
trace(circle); = _level0.circle
Can anyone see why this isn't working? The MC contains a shapetween.
Edit:
Ok so I have tested it in a new fla with the same MC and it isn't the MC that is the problem it has to do with some other part of my code preventing it.
Here is my entire code... can anyone see anything that would stop the tween to frame working? If I remove for (MovieClip in txts) {
txts[MovieClip]._alpha = 0;
} and put the tween above it it works, but as soon as it is inside a rollover again it doesn't.
Entire code:
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
TweenPlugin.activate([ColorTransformPlugin, FramePlugin]);
OverwriteManager.init(OverwriteManager.AUTO);
var angle:Number = 0;
var originX:Number = Stage.width/2;
var originY:Number = Stage.height/2;
var radiusX:Number = 320.5;
var radiusY:Number = 247.5;
var steps:Number = 360;
var speed:Number = 0.4/steps;
var circle:MovieClip = this.circle;
var circleTxt:MovieClip = this.circle.titleTxt;
var squareHeight:Number = 340.2;
var buttons:Array = new Array(this.faith, this.social, this.ability, this.age, this.orientation, this.ethnicity, this.sex);
var txts:Array = new Array("faithTxt", "socialTxt", "abilityTxt", "ageTxt", "orientationTxt", "ethnicityTxt", "sexTxt");
var tweens:Array = new Array();
for (MovieClip in txts) {
txts[MovieClip]._alpha = 0;
}
for (i=0; i<buttons.length; i++) {
buttons[i].onRollOver = function() {
var current:MovieClip = this;
circle.onEnterFrame = function() {
if (this._currentframe == 20) {
delete this.onEnterFrame;
delete circleTxt.onEnterFrame;
current.txt._alpha = 100;
}
};
noScale(circleTxt);
txtName = current._name+"Txt";
current.txt = this._parent.attachMovie(txtName, txtName, this._parent.getNextHighestDepth());
current.txt._alpha = 0;
circle.txtHeight = circle.active.txt._height/2+40;
var oppX:Number = Stage.width-this._x;
var oppY:Number = Stage.height-this._y;
if (oppX-227.8<=20) {
var difference:Number = Math.abs(20-(oppX-227.8));
oppX += difference;
} else if (oppX+227.8>=Stage.width-20) {
var difference:Number = Math.abs(780-(oppX+227.8));
oppX -= difference;
}
if (oppY-172.1<=20) {
var difference:Number = Math.abs(20-(oppY-172.1));
oppY += difference;
} else if (oppY+172.1>=580) {
var difference:Number = Math.abs(580-(oppY+172.1));
oppY -= difference;
}
circle.active.txt._x = oppX;
circle.active.txt._y = oppY;
TweenLite.to(circle,1,{frame:20});
TweenLite.to(circle,0.5,{_height:circle.txtHeight});
TweenLite.to(circle,1,{_x:oppX, _y:oppY, ease:Quint.easeInOut});
TweenLite.to(circleTxt,1,{_alpha:0});
TweenLite.to(this,0.5,{colorTransform:{tint:0x99ff00, tintAmount:0.5}});
for (MovieClip in buttons) {
delete buttons[MovieClip].onEnterFrame;
if (buttons[MovieClip] != this) {
TweenLite.to(buttons[MovieClip],0.5,{colorTransform:{tint:0xffffff, tintAmount:0.9}});
TweenLite.to(buttons[MovieClip]._line,0.5,{colorTransform:{tint:0xffffff, tintAmount:0.9}});
}
}
};
buttons[i].onRollOut = function() {
removeMovieClip(this.txt);
circle.onEnterFrame = function() {
if (this._currentframe == 1) {
delete this.onEnterFrame;
delete circleTxt.onEnterFrame;
}
};
noScale(circleTxt);
TweenLite.to(circle,0.2,{_height:173});
TweenLite.to(circle,0.5,{_x:Stage.width/2, _y:Stage.height/2});
TweenLite.to(circleTxt,1,{_alpha:100});
for (MovieClip in buttons) {
buttons[MovieClip].onEnterFrame = function() {
moveButtons(this);
controlButtons(this);
};
TweenLite.to(buttons[MovieClip],0.5,{colorTransform:{tint:null, tintAmount:0}});
TweenLite.to(buttons[MovieClip]._line,0.5,{colorTransform:{tint:null, tintAmount:0}});
}
};
buttons[i].onEnterFrame = function() {
moveButtons(this);
controlButtons(this);
};
buttons[i]._order = (360/buttons.length)*1000+(i+1);
buttons[i]._linedepth = buttons[i].getDepth()-1000;
}
function noScale(mc) {
mc.onEnterFrame = function() {
this._yscale = 10000/this._parent._yscale;
};
}
function moveButtons(e) {
var lineName:String = new String(e._name+"line");
var lineMC:MovieClip = createEmptyMovieClip(lineName, e._linedepth);
with (lineMC) {
beginFill();
lineStyle(2,0x000000,100);
moveTo(e._x,e._y);
lineTo(Stage.width/2,Stage.height/2);
endFill();
}
e.rotation = Math.atan2(e._y-Stage.height/2, e._x-Stage.width/2);
e._line.dist = Math.sqrt(Math.abs(e._x-Stage.width/2) ^ 2+Math.abs(e._y-Stage.height/2) ^ 2);
e._line = lineMC;
e._anglePhase = (angle+e._order)/Math.PI*2.8;
e._x = originX+Math.sin(e._anglePhase)*radiusX;
e._y = originY+Math.cos(e._anglePhase)*radiusY;
}
function controlButtons(e) {
angle += speed;
if (angle>=360) {
angle -= 360;
}
}
Heh Solved, for some reason it doesn't like for (MovieClip in Array){} anywhere in your code, so if I substitute that for for (a in Array){} it seems to work. Odd.

Resources